home *** CD-ROM | disk | FTP | other *** search
/ Now That's What I Call Games 3 / Now That's What I Call Games 3 - Games & Goodies (1993)(Multi Media Machine)[!][CD32-CDTV].iso / pd / snackman / snackman.s < prev    next >
Text File  |  1992-08-23  |  85KB  |  3,980 lines

  1. ; *******************************************************
  2. ; *                            *
  3. ; *    "SnackMan", (C) Copyright Stig A. Olsen, 1992    *
  4. ; *        INTERNET (email): stigo@ifi.uio.no        *
  5. ; *  Mail: 4A311 Kringsjaa, Sognsvn. 218, N-0864 OSLO     *
  6. ; *                            *
  7. ; *******************************************************
  8. ; Version: 1.00, 07.10.92
  9.     section    hoved,code_c    
  10. NONE = 0    ; direction constants
  11. RIGHT = 1    ; one bit per direction
  12. LEFT = 2
  13. UP = 4
  14. DOWN = 8    
  15.  
  16. BAD = 0     ; ghost status values
  17. EATABLE = 1    
  18. EATEN = 2
  19.  
  20. GPOS = 0    ; ghost-image structure offsets
  21. GPOSX = 0    ; x position
  22. GPOSY = 2    ; y position
  23. GDIR = 4    ; direction
  24. GSEED = 6    ; random seed
  25. GRIGHT = 10    ; right Sprite Image Pointer
  26. GLEFT = 14    ; left SIP
  27. GUP = 18    ; up SIP
  28. GDOWN = 22    ; down SIP
  29. GPTR = 26    ; copperlist sprite pointer for this sprite
  30. GSPEED = 30    ; ghost speed
  31. GSTATUS = 32    ; ghost status
  32. GDEAD = 34    ; dead SIP
  33.  
  34. STARTLIVES = 3    ; no of lives at start of game
  35. STARTSPEED = 1    ; speed of pac at start of game
  36. BOOSTTIME = 300 ; no of frames with vitamin boost
  37. BOOSTWARNING = 100 ; warning time before ghosts kill
  38.  
  39. start:
  40.     or.b     #%10000000,$bfd100
  41.     and.b     #%10000111,$bfd100 ; turn off drive motor
  42.  
  43.     move.w    #$20,$dff1dc    ; PAL mode (overweight Agnus only)
  44.  
  45.     move.w    #$012,$dff180
  46.     jsr    setupscreen    ; initialize screen pointers
  47.     jsr     mt_init
  48.  
  49.     move.l    $4,a6        ; Execbase
  50.     jsr    -120(a6)    ; Disable interrupts
  51.                 ; (also disables multitasking)
  52.     jsr    -132(a6)    ; Forbid multitasking
  53.     lea.l    grname,a1
  54.     jsr    -408(a6)    ; open gfx library
  55.     move.l    d0,a0
  56.     lea.l    oldcopper,a1
  57.     move.l    38(a0),(a1)    ; store old cprlist
  58.     lea.l    olddmacon,a1
  59.     move.w    $dff002,(a1)
  60.     bset    #15,(a1)
  61.  
  62.     jsr    introduction    ; startupscreen
  63.  
  64.     move.w    #$7fff,$dff096     ; clear/set DMA
  65.     lea.l    coplist,a0
  66.     move.l    a0,$dff080    ; sets my coplist
  67.     move.w    $dff088,d0    ; strobe
  68.     move.w    #$83e0,$dff096     ; ON|DMAEN|BPLEN|COP|BLIT|DISK
  69.  
  70.     move.w    $dff01c,oldintena
  71.     bset    #15,oldintena    ; activate set-bit
  72.     move.l    $6c,oldvbint    
  73.     move.w    #$7fff,$dff09a    ; turn off all interrupts
  74.     move.l    #vbint,$6c    ; set my interrupt
  75.     move.w    #$c020,$dff09a  ; turn on vertical blank interrupt
  76.  
  77. ;    **** INTIALIZATION ****
  78.  
  79.     jsr    updatelives
  80.     jsr    initsprite    ; set sprite pointers to blank sprite
  81.     jsr    initcollision    ; initialize collision register
  82.     jsr    gameover
  83.     bra    main        ; jump to main loop
  84.  
  85. ;    **** STANDARD STARTUP VARIABLES *****
  86.  
  87. oldcopper:    dc.l    0    ; standard initializing variables
  88. oldvbint:    dc.l    0
  89. olddmacon:    dc.w    0
  90. oldintena:    dc.w    0
  91. grname: dc.b    "graphics.library",0,0
  92.  
  93. ;     **** VERTICAL BLANKING INTERRUPT ROUTINE ****    
  94. vbint:
  95.     movem.l    d0-d7/a0-a6,-(a7)    ; save old values
  96.     jsr    pacimage    ; set right sprite pointer for pac
  97.     jsr    mt_music        ; do music
  98.     move.w    #$0020,$dff09c        ; clear vb interrupt    
  99.     movem.l    (a7)+,d0-d7/a0-a6     ; reset registers
  100.     rte
  101.  
  102.  
  103. ;     **** MAIN LOOP ****
  104.  
  105. main:
  106.     bsr    vblank        ; sync with rasterbeam
  107.  
  108.     ;move.w    #$017,$dff180     ; rastertime start
  109.  
  110.     jsr    checkjoystick    ; check joystick movement
  111.     jsr    movepac        ; find new pac position
  112.     jsr    setpac        ; set right position
  113.  
  114.     lea.l    ghost1,a6    ; set ghost structure pointer
  115.     jsr    ghostdir    ; choose new direction
  116.     jsr    ghostmove    ; update x/y variables
  117.     jsr    ghostset    ; set sprite on screen
  118.     jsr    checkflash    ; check if ghost eaten
  119.  
  120.     lea.l    ghost2,a6
  121.     jsr    ghostdir
  122.     jsr    ghostmove
  123.     jsr    ghostset
  124.     jsr    checkflash
  125.  
  126.     lea.l    ghost3,a6
  127.     jsr    ghostdir
  128.     jsr    ghostmove
  129.     jsr    ghostset
  130.     jsr    checkflash
  131.  
  132.     lea.l    ghost4,a6
  133.     jsr    ghostdir
  134.     jsr    ghostmove
  135.     jsr    ghostset
  136.     jsr    checkflash
  137.  
  138.     jsr    checkcollision
  139.  
  140.     jsr    eatcheese
  141.     jsr    alleaten
  142.     jsr    printscore
  143.     jsr    updatelives
  144.  
  145.     jsr    boostcheck
  146.  
  147.     ;move.w    #$012,$dff180     ; rastertime stop
  148.     btst    #6,$bfe001    ; left mousebutton
  149.     bne    main
  150.  
  151.  
  152. ;     **** CLEAN-UP ROUTINES  ****
  153.  
  154. end:
  155.     jsr    jatilef        ; endscreen
  156.     lea.l    oldcopper,a0
  157.     lea.l    olddmacon,a1
  158.     move.l    (a0),$dff080    ; restore copper
  159.     move.w    (a1),$dff096    ; restore dmacon
  160.     move.w    #$0,$dff088
  161.     move.w    #$7fff,$dff09a    ; turn off all interrupts
  162.     move.l    oldvbint,$6c    ; restore old interrupt
  163.     move.w    oldintena,$dff09a ; turn on old interrupts    
  164.     move.l    $4,a6        ; Execbase
  165.     jsr    -126(a6)    ; Enable
  166.     jsr    -138(a6)    ; Permit
  167.  
  168.     jsr    mt_end        ; kill music
  169.  
  170.     move.l    #$0,d0        ; no silly dos-errors in the
  171.     rts            ; startup-seq or other scripts
  172.  
  173. ;    **** END OF EXECUTION ****
  174.  
  175. ;    **** VERTICAL BLANK SYNC ****
  176.  
  177. vblank:                ; vertical blanking wait
  178.     cmp.b    #$00,$dff006
  179.     bne.s    vblank
  180.     btst    #0,$dff005
  181.     beq.s    vblank
  182.     rts
  183. realblank:            ; for turning off sprites
  184.     cmp.b    #$00,$dff006
  185.     bne.s    realblank
  186.     btst    #0,$dff005
  187.     bne.s    realblank
  188.     rts
  189.  
  190. ;    **** INITIALIZING ROUTINES ****
  191.  
  192. initcollision:
  193.     move.w    #$0000,$dff098    ; CLXCON
  194.     move.w    #0,collctr
  195.     rts
  196.  
  197. setupscreen:
  198.     lea.l    board,a0    ; boardpointer
  199.     lea.l    pl1h,a1        ; first plane pointer in copperlist
  200.     move.l    a0,d0
  201.     
  202.     move.w    d0,6(a1)    ; set least significant word
  203.     swap    d0
  204.     move.w    d0,2(a1)    ; set most significant word
  205.     swap    d0
  206.  
  207.     add.l    #10240,d0    ; next plane for board
  208.     add.l    #8,a1        ; next pointer in copperlist
  209.     move.w    d0,6(a1)
  210.     swap    d0
  211.     move.w    d0,2(a1)
  212.     swap    d0
  213.  
  214.     add.l    #10240,d0
  215.     add.l    #8,a1
  216.     move.w    d0,6(a1)
  217.     swap    d0
  218.     move.w    d0,2(a1)
  219.  
  220.     lea.l    cheeseboard,a0
  221.     move.l    a0,d0
  222.     add.l    #8,a1
  223.     move.w    d0,6(a1)
  224.     swap    d0
  225.     move.w    d0,2(a1)
  226.  
  227.     lea.l    scoreboard,a0
  228.     lea.l    scr1h,a1
  229.     move.l    a0,d0
  230.     move.w    d0,6(a1)
  231.     swap    d0
  232.     move.w    d0,2(a1)
  233.  
  234.     lea.l    infoscreen,a0
  235.     lea.l    pl5h,a1
  236.     move.l    a0,d0
  237.     move.w    d0,6(a1)
  238.     swap    d0
  239.     move.w    d0,2(a1)
  240.     rts
  241.  
  242. initsprite:
  243.     lea.l    nullspr,a0    ; set sprites to null
  244.     lea.l    spr1h,a1
  245.     move.l    a0,d0
  246.  
  247.     move.w    d0,6(a1)    ; 0
  248.     move.w    d0,14(a1)    ; 1
  249.     move.w    d0,22(a1)    ; 2
  250.     move.w    d0,30(a1)    ; 3
  251.     move.w    d0,38(a1)    ; 4
  252.     move.w    d0,46(a1)    ; 5
  253.     move.w    d0,54(a1)    ; 6
  254.     move.w    d0,62(a1)    ; 7
  255.     swap    d0
  256.     move.w    d0,2(a1)    ; 0
  257.     move.w    d0,10(a1)    ; 1
  258.     move.w    d0,18(a1)    ; 2
  259.     move.w    d0,26(a1)    ; 3
  260.     move.w    d0,34(a1)    ; 4
  261.     move.w    d0,42(a1)    ; 5
  262.     move.w    d0,50(a1)    ; 6
  263.     move.w    d0,58(a1)    ; 7
  264.     rts
  265.  
  266. drawboard:
  267.     ; put pointer to boarddata in a0
  268.     lea.l    board,a2    ; graphic area for board    
  269.  
  270.     move.w    #14,d7        ; height = 15 words
  271. outerloop:
  272.     move.w    #19,d6        ; width = 20 words
  273. innerloop:            ; 1 block = 16x16 pixels
  274.     lea.l    blocks,a1
  275.     move.b    (a0)+,d0
  276.     and.w    #$00ff,d0
  277.     cmp.w    #19,d0
  278.     ble    not2ndrow
  279.     sub.w    #20,d0
  280.     add.l    #640,a1
  281. not2ndrow:
  282.     add.w    d0,d0
  283.     add.w    d0,a1
  284.  
  285.     move.l    #$dff000,a6
  286.     jsr    waitblit    ; wait for until blitter is ready
  287.     move.l     a1,$50(a6)    ; A channel pointer
  288.     move.l     a2,$54(a6)    ; D channel pointer
  289.     move.w     #38,$64(a6)    ; modulo i bytes A kanal
  290.     move.w     #38,$66(a6)    ; modulo i bytes D kanal
  291.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  292.     move.w  #$09f0,$40(a6)    ; blitcon0
  293.     move.w     #$0000,$42(a6)    ; blitcon1
  294.     move.w     #64*16+1,$58(a6); blitsize
  295.     add.l    #10240,a2
  296.     add.l    #1920,a1
  297.     jsr    waitblit
  298.     move.l     a1,$50(a6)    ; next bitplane
  299.     move.l     a2,$54(a6)
  300.     move.w     #38,$64(a6)
  301.     move.w     #38,$66(a6)
  302.     move.l     #$ffffffff,$44(a6)
  303.     move.w  #$09f0,$40(a6)
  304.     move.w     #$0000,$42(a6)
  305.     move.w     #64*16+1,$58(a6)
  306.     add.l    #1920,a1
  307.     add.l    #10240,a2
  308.     jsr    waitblit
  309.     move.l    a1,$50(a6)
  310.     move.l     a2,$54(a6)
  311.     move.w     #38,$64(a6)
  312.     move.w     #38,$66(a6)
  313.     move.l     #$ffffffff,$44(a6)
  314.     move.w  #$09f0,$40(a6)
  315.     move.w     #$0000,$42(a6)
  316.     move.w     #64*16+1,$58(a6)
  317.     add.l    #1920,a1
  318.     add.l    #10240,a2
  319.     jsr    waitblit
  320.     move.l     a1,$50(a6)
  321.     move.l     a2,$54(a6)
  322.     move.w     #38,$64(a6)
  323.     move.w     #38,$66(a6)
  324.     move.l     #$ffffffff,$44(a6)
  325.     move.w  #$09f0,$40(a6)
  326.     move.w     #$0000,$42(a6)
  327.     move.w     #64*16+1,$58(a6)
  328.     
  329.     sub.l    #30720,a2    ; subtract bitplanes
  330.     add.l    #2,a2        ; go to next position
  331.     dbra    d6,innerloop    ; next horizontal block
  332.     add.l    #600,a2
  333.     dbra    d7,outerloop    ; next vertical line
  334.     rts
  335.  
  336. initcheese:
  337.     ; put pointer to cheesedata in a0
  338.     lea.l    newtab,a1
  339.     move.w    #159,d7
  340. cpyloop:
  341.     move.w    (a0)+,(a1)+
  342.     dbra    d7,cpyloop
  343.     jsr    clearcheese
  344.     lea.l    newtab,a0
  345.     lea.l    cheeseboard,a2
  346.     move.w    #0,cheesecount
  347.     move.w    #0,cheeseeaten    
  348.     move.w    #14,d7
  349. icoloop:        ; InitCheeseOuterLoop
  350.     move.w    #19,d6
  351. iciloop:        ; InitCheeseInnerLoop
  352.     move.b    (a0)+,d0
  353.     cmp.b    #1,d0
  354.     bne    no_cheese
  355.     add.w    #1,cheesecount
  356.     lea.l    cheese,a1    ; image to screen with '68000
  357.     move.w    (a1)+,(a2)    ;0
  358.     add.w    #40,a2
  359.     move.w    (a1)+,(a2)    ;1
  360.     add.w    #40,a2
  361.     move.w    (a1)+,(a2)    ;2
  362.     add.w    #40,a2
  363.     move.w    (a1)+,(a2)    ;3
  364.     add.w    #40,a2
  365.     move.w    (a1)+,(a2)    ;4
  366.     add.w    #40,a2
  367.     move.w    (a1)+,(a2)    ;5
  368.     add.w    #40,a2
  369.     move.w    (a1)+,(a2)    ;6
  370.     add.w    #40,a2
  371.     move.w    (a1)+,(a2)    ;7
  372.     add.w    #40,a2
  373.     move.w    (a1)+,(a2)    ;8
  374.     add.w    #40,a2
  375.     move.w    (a1)+,(a2)    ;9
  376.     add.w    #40,a2
  377.     move.w    (a1)+,(a2)    ;a
  378.     add.w    #40,a2
  379.     move.w    (a1)+,(a2)    ;b
  380.     add.w    #40,a2
  381.     move.w    (a1)+,(a2)    ;c
  382.     add.w    #40,a2
  383.     move.w    (a1)+,(a2)    ;d
  384.     add.w    #40,a2
  385.     move.w    (a1)+,(a2)    ;e
  386.     add.w    #40,a2
  387.     move.w    (a1)+,(a2)    ;f
  388.     sub.l    #[40*15],a2    
  389. no_cheese:
  390.     cmp.b    #2,d0
  391.     bne    no_vitamin
  392.     lea.l    vitamin,a1    ; image to screen with '68000
  393.     move.w    (a1)+,(a2)    ;0
  394.     add.w    #40,a2
  395.     move.w    (a1)+,(a2)    ;1
  396.     add.w    #40,a2
  397.     move.w    (a1)+,(a2)    ;2
  398.     add.w    #40,a2
  399.     move.w    (a1)+,(a2)    ;3
  400.     add.w    #40,a2
  401.     move.w    (a1)+,(a2)    ;4
  402.     add.w    #40,a2
  403.     move.w    (a1)+,(a2)    ;5
  404.     add.w    #40,a2
  405.     move.w    (a1)+,(a2)    ;6
  406.     add.w    #40,a2
  407.     move.w    (a1)+,(a2)    ;7
  408.     add.w    #40,a2
  409.     move.w    (a1)+,(a2)    ;8
  410.     add.w    #40,a2
  411.     move.w    (a1)+,(a2)    ;9
  412.     add.w    #40,a2
  413.     move.w    (a1)+,(a2)    ;a
  414.     add.w    #40,a2
  415.     move.w    (a1)+,(a2)    ;b
  416.     add.w    #40,a2
  417.     move.w    (a1)+,(a2)    ;c
  418.     add.w    #40,a2
  419.     move.w    (a1)+,(a2)    ;d
  420.     add.w    #40,a2
  421.     move.w    (a1)+,(a2)    ;e
  422.     add.w    #40,a2
  423.     move.w    (a1)+,(a2)    ;f
  424.     sub.l    #[40*15],a2    
  425. no_vitamin:
  426.     add.l    #2,a2
  427.     dbra    d6,iciloop
  428.     add.l    #600,a2
  429.     dbra    d7,icoloop
  430.     rts    
  431.     
  432. clearcheese:
  433.     jsr    waitblit
  434.     move.l     #cheeseboard,$54(a6)    ; D kanal peker
  435.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  436.     move.l     #$ffffffff,$44(a6) ; blitter mask
  437.     move.w  #$0100,$40(a6)    ; blitcon0
  438.     move.w     #$0000,$42(a6)    ; blitcon1
  439.     move.w     #64*256+20,$58(a6)    ; blitsize
  440.     jsr    waitblit    ; must wait here!
  441.     rts
  442.  
  443. ;    **** OTHER ROUTINES ****
  444. waitblit:
  445.     btst    #14,$dff002    ; blitter ready?
  446.     nop            
  447.     bne.s    waitblit
  448.     rts
  449.  
  450. checkcollision:            ; this routine is a kludge
  451.     add.w    #1,collctr    ; fix it later
  452.     move.w    collctr,d0
  453.     btst    #0,d0
  454.     beq    fr2
  455. fr1:
  456.     move.w    $dff00e,coll1
  457.     move.w    #$e000,$dff098
  458.     rts
  459. fr2:
  460.     move.w    $dff00e,coll2
  461.     move.w    #$0000,$dff098
  462.     
  463.     move.w    coll1,d0
  464.     btst    #9,d0
  465.     bne    img1coll
  466.     btst    #10,d0
  467.     bne    img3coll
  468.     move.w    coll2,d0
  469.     btst    #9,d0
  470.     bne    img2coll        
  471.     btst    #10,d0
  472.     bne    img4coll
  473.     rts
  474. img1coll:
  475.     lea.l    ghost1,a6
  476.     bra    collision
  477. img2coll:
  478.     lea.l    ghost2,a6
  479.     move.w    pacpos,d0
  480.     sub.w    GPOSX(a6),d0
  481.     bpl    img2plus1
  482.     neg.w    d0
  483. img2plus1:
  484.     cmp.w    #$10,d0
  485.     bhi    fake
  486.     move.w    pacpos+2,d0
  487.     sub.w    GPOSY(a6),d0
  488.     bpl    img2plus2
  489.     neg.w    d0
  490. img2plus2:
  491.     cmp.w    #$10,d0
  492.     bhi    fake
  493.     bra    collision
  494. fake:
  495.     rts
  496. img3coll:
  497.     lea.l    ghost3,a6
  498.     bra    collision
  499. img4coll:
  500.     lea.l    ghost4,a6
  501.     move.w    pacpos,d0
  502.     sub.w    GPOSX(a6),d0
  503.     bpl    img4plus1
  504.     neg.w    d0
  505. img4plus1:
  506.     cmp.w    #$10,d0
  507.     bhi    fake
  508.     move.w    pacpos+2,d0
  509.     sub.w    GPOSY(a6),d0
  510.     bpl    img4plus2
  511.     neg.w    d0
  512. img4plus2:
  513.     cmp.w    #$10,d0
  514.     bhi    fake
  515. collision:
  516.     move.w    GSTATUS(a6),d0
  517.     cmp.w    #BAD,d0
  518.     beq    badone
  519.     cmp.w    #EATABLE,d0
  520.     beq    edible
  521.     ; STATUS = EATEN
  522.     rts    
  523. badone:
  524.     jsr    badcollision
  525.     rts
  526. edible:
  527.     move.w    #EATEN,GSTATUS(a6)
  528.     jsr    fivepoints
  529.     rts
  530.  
  531. checkflash:
  532.     move.w    GSTATUS(a6),d0
  533.     cmp.w    #EATEN,d0
  534.     bne    checkend
  535.     move.l    GDEAD(a6),d0
  536.     move.l    GPTR(a6),a0
  537.     move.w    d0,6(a0)
  538.     swap    d0
  539.     move.w    d0,2(a0)
  540. checkend:
  541.     rts    
  542.  
  543. badcollision:
  544.     sub.b    #1,lives
  545.     jsr    updatelives    
  546.     jsr    gotyou
  547.  
  548.     move.l    #$009800d8,pacpos    ; initial pac position
  549.     move.l    #pacBALL,dirpac
  550.     move.w    #NONE,joydirection
  551.     move.w    #NONE,curdir
  552.     jsr    setpac
  553.     lea.l    ghost1,a6        ; initial ghost positions
  554.     move.l    #$00380018,GPOS(a6)
  555.     jsr    ghostset
  556.     lea.l    ghost2,a6
  557.     move.l    #$00680018,GPOS(a6)
  558.     jsr    ghostset
  559.     lea.l    ghost3,a6
  560.     move.l    #$00980018,GPOS(a6)
  561.     jsr    ghostset
  562.     lea.l    ghost4,a6
  563.     move.l    #$00c80018,GPOS(a6)
  564.     move.w    boost,d0
  565.     beq    checkgameover
  566.     move.w    pacspeed,d0    ; loose vitamin when
  567.     lsr.w    #1,d0        ; you loose a life
  568.     move.w    d0,pacspeed
  569.     move.w    #0,boost
  570.  
  571. checkgameover:
  572.     move.b    lives,d0
  573.     cmp.b    #0,d0
  574.     bne    notgameover
  575.     bra    gameover
  576. notgameover:
  577.     jsr    ghostset
  578.     jsr    getready
  579.     jsr    go
  580.     rts
  581.  
  582. setpac:
  583.     moveq    #0,d2        ; sprite control longword
  584.     moveq    #0,d3
  585.     move.w    pacpos+2,d1    ; y pos
  586.     move.w    pacpos,d0    ; x pos
  587.     
  588.     add.w    #$78,d0        ; offset to get image to screen
  589.     add.w    #$25,d1
  590.  
  591.     move.w    d1,d4
  592.     add.w    #$10,d4        ; sprite height, 16 lines
  593.     
  594.     move.b    d1,d2
  595.     rol.w    #8,d2
  596.  
  597.     move.w    d4,d3
  598.     rol.w    #8,d3
  599.  
  600.     btst    #8,d1
  601.     beq    vstartmsbCLR
  602.     bset    #2,d3
  603. vstartmsbCLR:
  604.     btst    #8,d4
  605.     beq    vstopmsbCLR
  606.     bset    #1,d3
  607. vstopmsbCLR:
  608.  
  609.     lsr.w    #1,d0
  610.     bcs    hstartlsbSET
  611.     move.b    d0,d2
  612.     bclr    #0,d3    
  613.     bra    posOK
  614. hstartlsbSET:
  615.     move.b    d0,d2
  616.     bset    #0,d3    
  617. posOK:
  618.     swap    d2
  619.     move.w    d3,d2
  620.     move.l    d2,pacBALL    
  621.     move.l    d2,pacL
  622.     move.l    d2,pacR
  623.     move.l    d2,pacU
  624.     move.l    d2,pacD        ; update all pac-sprites
  625.     rts
  626.  
  627. checkjoystick:
  628.     lea.l    joydirection,a0    ; check for joystick push
  629.     move.w    $dff00c,d0
  630.     btst    #1,d0
  631.     bne    rightpressed
  632.     btst    #9,d0
  633.     bne    leftpressed        
  634.     btst    #0,d0
  635.     bne    downpressed
  636.     btst    #8,d0
  637.     bne    uppressed
  638.  
  639.     ;move.l    #NONE,(a0)    ; remove this in finished version
  640.     rts
  641.  
  642. rightpressed:
  643.     move.w    #RIGHT,(a0)
  644.     rts
  645. leftpressed:
  646.     move.w    #LEFT,(a0)
  647.     rts
  648. downpressed:
  649.     move.w    #DOWN,(a0)
  650.     rts
  651. uppressed:
  652.     move.w    #UP,(a0)
  653.     rts
  654.  
  655. movepac:
  656.     move.w    joydirection,d0
  657.     cmp.w    #RIGHT,d0
  658.     bne    next1
  659.     move.l    pacpos,testpos
  660.     move.w    pacspeed,d5
  661.     add.w    d5,testpos
  662.     jsr    testposition
  663.     tst.w    d0
  664.     beq    next4
  665.     move.w    pacspeed,d5
  666.     add.w    d5,pacpos
  667.     move.l    #pacR,dirpac
  668.     move.w    #RIGHT,curdir
  669.     rts
  670. next1:
  671.     cmp.w    #LEFT,d0
  672.     bne    next2
  673.     move.l    pacpos,testpos
  674.     move.w    pacspeed,d5
  675.     sub.w    d5,testpos
  676.     jsr    testposition
  677.     tst.w    d0
  678.     beq    next4
  679.     move.w    pacspeed,d5
  680.     sub.w    d5,pacpos
  681.     move.l    #pacL,dirpac
  682.     move.w    #LEFT,curdir
  683.     rts
  684. next2:
  685.     cmp.w    #UP,d0
  686.     bne    next3
  687.     move.l    pacpos,testpos
  688.     move.w    pacspeed,d5
  689.     sub.w    d5,testpos+2
  690.     jsr    testposition
  691.     tst.w    d0
  692.     beq    next4
  693.     move.w    pacspeed,d5
  694.     sub.w    d5,pacpos+2
  695.     move.l    #pacU,dirpac
  696.     move.w    #UP,curdir
  697.     rts
  698. next3:
  699.     cmp.w    #DOWN,d0
  700.     bne    next4
  701.     move.l    pacpos,testpos
  702.     move.w    pacspeed,d5
  703.     add.w    d5,testpos+2
  704.     jsr    testposition
  705.     tst.w    d0
  706.     beq    next4
  707.     move.w    pacspeed,d5
  708.     add.w    d5,pacpos+2
  709.     move.l    #pacD,dirpac
  710.     move.w    #DOWN,curdir
  711.     rts
  712. next4:
  713.     move.w    curdir,d0
  714.     cmp.w    #RIGHT,d0
  715.     bne    nexxt1
  716.     move.l    pacpos,testpos
  717.     move.w    pacspeed,d5
  718.     add.w    d5,testpos
  719.     jsr    testposition
  720.     tst.w    d0
  721.     beq    nexxt4
  722.     move.w    pacspeed,d5
  723.     add.w    d5,pacpos
  724.     move.l    #pacR,dirpac
  725.     move.w    #RIGHT,curdir
  726.     rts
  727. nexxt1:
  728.     cmp.w    #LEFT,d0
  729.     bne    nexxt2
  730.     move.l    pacpos,testpos
  731.     move.w    pacspeed,d5
  732.     sub.w    d5,testpos
  733.     jsr    testposition
  734.     tst.w    d0
  735.     beq    nexxt4
  736.     move.w    pacspeed,d5
  737.     sub.w    d5,pacpos
  738.     move.l    #pacL,dirpac
  739.     move.w    #LEFT,curdir
  740.     rts
  741. nexxt2:
  742.     cmp.w    #UP,d0
  743.     bne    nexxt3
  744.     move.l    pacpos,testpos
  745.     move.w    pacspeed,d5
  746.     sub.w    d5,testpos+2
  747.     jsr    testposition
  748.     tst.w    d0
  749.     beq    nexxt4
  750.     move.w    pacspeed,d5
  751.     sub.w    d5,pacpos+2
  752.     move.l    #pacU,dirpac
  753.     move.w    #UP,curdir
  754.     rts
  755. nexxt3:
  756.     cmp.w    #DOWN,d0
  757.     bne    nexxt4
  758.     move.l    pacpos,testpos
  759.     move.w    pacspeed,d5
  760.     add.w    d5,testpos+2
  761.     jsr    testposition
  762.     tst.w    d0
  763.     beq    nexxt4
  764.     move.w    pacspeed,d5
  765.     add.w    d5,pacpos+2
  766.     move.l    #pacD,dirpac
  767.     move.w    #DOWN,curdir
  768.     rts
  769. nexxt4:
  770.     move.l    #pacBALL,dirpac    
  771.     move.w    #NONE,curdir
  772.     rts
  773.  
  774. pacimage:
  775.     lea.l    spr1h,a0
  776.     add.w    #1,dirctr
  777.     btst    #3,dirctr+1
  778.     beq    ball
  779.     move.l    dirpac,d0
  780.     move.w    d0,6(a0)
  781.     swap    d0
  782.     move.w    d0,2(a0)
  783.     rts
  784. ball:
  785.     move.l    #pacBALL,d0
  786.     move.w    d0,6(a0)
  787.     swap    d0
  788.     move.w    d0,2(a0)
  789.     rts    
  790.         ; check if loaction is a valid image-location
  791. testposition:
  792.     lea.l    board+[10240*3],a0
  793.     lea.l    invtable,a2
  794.     move.w    testpos+2,d0
  795.     mulu.w    #40,d0
  796.     add.w    d0,a0    ; + vertical
  797.  
  798.     move.w    testpos,d0
  799.     move.w    d0,d1
  800.     and.w    #$7,d1
  801.     add.w    d1,d1
  802.     move.w    (a2,d1.w),d1
  803.  
  804.     lsr    #3,d0
  805.     add.w    d0,a0    ; + horizontal
  806.  
  807.     btst    d1,(a0)
  808.     beq    faultypos
  809.     move.w    #-1,d0
  810.     rts
  811. faultypos:
  812.     move.w    #$0,d0
  813.     rts
  814.  
  815. ghostdir:
  816.     moveq    #0,d7
  817.     move.l    GPOS(a6),testpos
  818.     move.w    GSPEED(a6),d5
  819.     add.w    d5,testpos
  820.     jsr    testposition
  821.     tst.w    d0
  822.     beq    ghostrna
  823.     or.w    #RIGHT,d7
  824. ghostrna:    
  825.     move.l    GPOS(a6),testpos
  826.     move.w    GSPEED(a6),d5
  827.     sub.w    d5,testpos
  828.     jsr    testposition
  829.     tst.w    d0
  830.     beq    ghostlna
  831.     or.w    #LEFT,d7
  832. ghostlna:
  833.     move.l    GPOS(a6),testpos
  834.     move.w    GSPEED(a6),d5
  835.     add.w    d5,testpos+2
  836.     jsr    testposition
  837.     tst.w    d0
  838.     beq    ghostdna
  839.     or.w    #DOWN,d7
  840. ghostdna:
  841.     move.l    GPOS(a6),testpos
  842.     move.w    GSPEED(a6),d5
  843.     sub.w    d5,testpos+2
  844.     jsr    testposition
  845.     tst.w    d0
  846.     beq    ghostuna
  847.     or.w    #UP,d7
  848. ghostuna:
  849.     lea.l    bitcnttable,a0
  850.     lea.l    oppositetable,a1
  851.     lea.l    selecttable,a2
  852.  
  853.     move.w    d7,d6
  854.     add.w    d6,d6
  855.     move.w    (a0,d6.w),d6
  856.     cmp.w    #1,d6    
  857.     beq    ghostend
  858.     
  859.     move.w    GDIR(a6),d6    ; clear the opposite direction
  860.     add.w    d6,d6
  861.     move.w    (a1,d6.w),d6
  862.     not.w    d6
  863.     and.w    d6,d7
  864.     
  865.     move.w    d7,d6
  866.     add.w    d6,d6
  867.     move.w    (a0,d6.w),d6
  868.     cmp.w    #1,d6
  869.     beq    ghostend
  870.     
  871.     ;move.l    GSEED(a6),d0    ; simple randomgenerator routine
  872.     move.l    RANDOMSEED,d0
  873.     rol.l    #3,d0
  874.     eor.l    #$26754ace,d0    ; another "random" number
  875.     ;move.l    d0,GSEED(a6)
  876.     move.l    d0,RANDOMSEED    
  877.  
  878.     and.l    #$f8,d0        ; 8 byte alignment
  879.     move.w    (a2,d0.w),d1    ; clear 2nd unwanted direction
  880.     not.w    d1
  881.     and.w    d1,d7
  882.  
  883.     move.w    d7,d6
  884.     add.w    d6,d6
  885.     move.w    (a0,d6.w),d6
  886.     cmp.w    #1,d6
  887.     beq    ghostend
  888.  
  889.     add.w    #2,d0
  890.     move.w    (a2,d0.w),d1    ; clear 3rd unwanted direction
  891.     not.w    d1
  892.     and.w    d1,d7
  893.  
  894.     move.w    d7,d6
  895.     add.w    d6,d6
  896.     move.w    (a0,d6.w),d6
  897.     cmp.w    #1,d6
  898.     beq    ghostend
  899.  
  900.     add.w    #2,d0
  901.     move.w    (a2,d0.w),d1    ; clear 4th unwanted direction
  902.     not    d1        ; do we ever get here?
  903.     and.w    d1,d7        ; hope not! :-)
  904.  
  905. ghostend:    
  906.     move.w    d7,GDIR(a6)    
  907.     rts
  908.  
  909. ghostmove:
  910.     move.w    GDIR(a6),d0
  911.     cmp.w    #RIGHT,d0
  912.     bne    ghostnext1
  913.     move.w    GSPEED(a6),d5
  914.     add.w    d5,GPOSX(a6)
  915.     move.l    GRIGHT(a6),d0
  916.     move.l    GPTR(a6),a0
  917.     move.w    d0,6(a0)
  918.     swap    d0
  919.     move.w    d0,2(a0)
  920.     rts
  921. ghostnext1:    
  922.     cmp.w    #LEFT,d0
  923.     bne    ghostnext2
  924.     move.w    GSPEED(a6),d5
  925.     sub.w    d5,GPOSX(a6)
  926.     move.l    GLEFT(a6),d0
  927.     move.l    GPTR(a6),a0
  928.     move.w    d0,6(a0)
  929.     swap    d0
  930.     move.w    d0,2(a0)
  931.     rts
  932. ghostnext2:
  933.     cmp.w    #UP,d0
  934.     bne    ghostnext3
  935.     move.w    GSPEED(a6),d5
  936.     sub.w    d5,GPOSY(a6)
  937.     move.l    GUP(a6),d0
  938.     move.l    GPTR(a6),a0
  939.     move.w    d0,6(a0)
  940.     swap    d0
  941.     move.w    d0,2(a0)
  942.     rts
  943. ghostnext3:
  944.     cmp.w    #DOWN,d0
  945.     bne    ghostnext4
  946.     move.w    GSPEED(a6),d5
  947.     add.w    d5,GPOSY(a6)
  948.     move.l    GDOWN(a6),d0
  949.     move.l    GPTR(a6),a0
  950.     move.w    d0,6(a0)
  951.     swap    d0
  952.     move.w    d0,2(a0)
  953.     rts
  954. ghostnext4:
  955.     rts
  956.  
  957. ghostset:
  958.     moveq    #0,d2        ; sprite control longword
  959.     moveq    #0,d3
  960.     move.w    GPOSY(a6),d1    ; y pos
  961.     move.w    GPOSX(a6),d0    ; x pos
  962.     
  963.     add.w    #$78,d0
  964.     add.w    #$25,d1
  965.  
  966.     move.w    d1,d4
  967.     add.w    #$10,d4        ; sprite height
  968.     
  969.     move.b    d1,d2
  970.     rol.w    #8,d2
  971.  
  972.     move.w    d4,d3
  973.     rol.w    #8,d3
  974.  
  975.     btst    #8,d1
  976.     beq    ghostvstartmsbCLR
  977.     bset    #2,d3
  978. ghostvstartmsbCLR:
  979.     btst    #8,d4
  980.     beq    ghostvstopmsbCLR
  981.     bset    #1,d3
  982. ghostvstopmsbCLR:
  983.  
  984.     lsr.w    #1,d0
  985.     bcs    ghosthstartlsbSET
  986.     move.b    d0,d2
  987.     bclr    #0,d3    
  988.     bra    ghostposOK
  989. ghosthstartlsbSET:
  990.     move.b    d0,d2
  991.     bset    #0,d3    
  992. ghostposOK:
  993.     swap    d2
  994.     move.w    d3,d2    
  995.     move.l    GLEFT(a6),a0
  996.     move.l    d2,(a0)
  997.     move.l    GRIGHT(a6),a0
  998.     move.l    d2,(a0)
  999.     move.l    GUP(a6),a0
  1000.     move.l    d2,(a0)
  1001.     move.l    GDOWN(a6),a0
  1002.     move.l    d2,(a0)        ; update spritepointers for image
  1003.     move.l    GDEAD(a6),a0
  1004.     move.l    d2,(a0)
  1005.     rts
  1006.  
  1007. eatcheese:
  1008.     move.w    pacpos,d0    ;x
  1009.     move.w    pacpos+2,d1    ;y
  1010.     lsr.w    #4,d0
  1011.     lsr.w    #4,d1
  1012.     move.w    d0,d2
  1013.     move.w    d1,d3
  1014.     mulu.w    #20,d1
  1015.     add.w    d1,d0
  1016.     lea.l    newtab,a0
  1017.     add.w    d0,a0
  1018.     move.b    (a0),d1
  1019.     cmp.b    #1,d1    ;    1 = cheese
  1020.     beq    foundcheese
  1021.     cmp.b    #2,d1    ;    2 = vitamin (no other snacks yet)
  1022.     beq    foundvitamin
  1023.     rts
  1024. foundcheese:    
  1025.     move.b    #00,(a0)    ; clear cheese in table
  1026.     add.w    #1,cheeseeaten    ; we've just eaten one
  1027.     jsr    onepoint
  1028.     bra    clearobject
  1029. foundvitamin:
  1030.     move.b    #00,(a0)     ; clear vitamin in table
  1031.     lea.l    ghost1,a6
  1032.     move.w    #EATABLE,GSTATUS(a6)
  1033.     lea.l    ghost2,a6
  1034.     move.w    #EATABLE,GSTATUS(a6)
  1035.     lea.l    ghost3,a6
  1036.     move.w    #EATABLE,GSTATUS(a6)
  1037.     lea.l    ghost4,a6
  1038.     move.w    #EATABLE,GSTATUS(a6)
  1039.     move.w    #$35c,col12    ; new eatable color
  1040.     move.w    #$35c,col34
  1041.     jsr    tenpoints
  1042.     move.w    boost,d0
  1043.     beq    noboosting
  1044.     move.w    #-1,boost 
  1045. noboosting:
  1046.     add.w    #BOOSTTIME,boost ; boost-speed for n frames
  1047.     and.w    #$fff8,pacpos    ; align position
  1048.     and.w    #$fff8,pacpos+2
  1049.     bra    clearobject
  1050. clearobject:
  1051.     lea.l    cheeseboard,a1
  1052.     move.w    pacpos,d0
  1053.     lsr.w    #4,d0
  1054.     add.w    d0,d0
  1055.     add.w    d0,a1
  1056.     move.w    pacpos+2,d1
  1057.     lsr.w    #4,d1
  1058.     mulu.w    #640,d1
  1059.     add.w    d1,a1
  1060.     move.w    #$0000,(a1)
  1061.     add.w    #40,a1
  1062.     move.w    #$0000,(a1)
  1063.     add.w    #40,a1
  1064.     move.w    #$0000,(a1)
  1065.     add.w    #40,a1
  1066.     move.w    #$0000,(a1)
  1067.     add.w    #40,a1
  1068.     move.w    #$0000,(a1)
  1069.     add.w    #40,a1
  1070.     move.w    #$0000,(a1)
  1071.     add.w    #40,a1
  1072.     move.w    #$0000,(a1)
  1073.     add.w    #40,a1
  1074.     move.w    #$0000,(a1)
  1075.     add.w    #40,a1
  1076.     move.w    #$0000,(a1)
  1077.     add.w    #40,a1
  1078.     move.w    #$0000,(a1)
  1079.     add.w    #40,a1
  1080.     move.w    #$0000,(a1)
  1081.     add.w    #40,a1
  1082.     move.w    #$0000,(a1)
  1083.     add.w    #40,a1
  1084.     move.w    #$0000,(a1)
  1085.     add.w    #40,a1
  1086.     move.w    #$0000,(a1)
  1087.     add.w    #40,a1
  1088.     move.w    #$0000,(a1)
  1089.     rts
  1090.  
  1091. boostcheck:
  1092.     move.w    boost,d0
  1093.     cmp.w    #BOOSTTIME,d0
  1094.     beq    newboost
  1095.     cmp.w    #1,d0
  1096.     beq    lastboost
  1097.     cmp.w    #0,d0
  1098.     bne    activeboost
  1099.     rts
  1100. activeboost:
  1101.     sub.w    #1,boost
  1102.     cmp.w    #BOOSTWARNING,d0
  1103.     bls    warn_end_of_boost
  1104.     rts
  1105. warn_end_of_boost:
  1106.     btst    #4,d0
  1107.     beq    bluecol
  1108.     move.w    #$c35,col12    ; flash ghosts
  1109.     move.w    #$3c5,col34
  1110.     rts
  1111. bluecol:
  1112.     move.w    #$35c,col12
  1113.     move.w    #$35c,col34
  1114.     rts
  1115. lastboost:
  1116.     move.w    pacspeed,d0
  1117.     lsr.w    #1,d0
  1118.     cmp.w    #16,d0
  1119.     bge    maxspeed
  1120.     move.w    d0,pacspeed
  1121.     sub.w    #1,boost
  1122.     lea.l    ghost1,a6
  1123.     move.w    #BAD,GSTATUS(a6)
  1124.     lea.l    ghost2,a6
  1125.     move.w    #BAD,GSTATUS(a6)
  1126.     lea.l    ghost3,a6
  1127.     move.w    #BAD,GSTATUS(a6)
  1128.     lea.l    ghost4,a6
  1129.     move.w    #BAD,GSTATUS(a6)
  1130.     move.w    #$c35,col12
  1131.     move.w    #$3c5,col34
  1132.     rts    
  1133. maxspeed:
  1134.     move.w    #0,boost
  1135.     rts
  1136. newboost:
  1137.     move.w    pacspeed,d0
  1138.     lsl.w    #1,d0
  1139.     move.w    d0,pacspeed
  1140.     sub.w    #1,boost
  1141.     rts
  1142.  
  1143. alleaten:
  1144.     move.w    cheesecount,d0
  1145.     move.w    cheeseeaten,d1
  1146.     cmp.w    d0,d1
  1147.     beq    no_more_cheese
  1148.     rts
  1149. no_more_cheese:
  1150.     jsr    printscore
  1151.     jsr    initsprite
  1152.     move.l    #$009800d8,pacpos    ; initial pac position
  1153.     move.l    #pacBALL,dirpac
  1154.     move.w    #NONE,joydirection
  1155.     move.w    #NONE,curdir
  1156.     jsr    setpac
  1157.     lea.l    ghost1,a6        ; initial ghost positions
  1158.     move.l    #$00380018,GPOS(a6)
  1159.     move.w    #BAD,GSTATUS(a6)
  1160.     jsr    ghostset
  1161.     lea.l    ghost2,a6
  1162.     move.l    #$00680018,GPOS(a6)
  1163.     move.w    #BAD,GSTATUS(a6)
  1164.     jsr    ghostset
  1165.     lea.l    ghost3,a6
  1166.     move.l    #$00980018,GPOS(a6)
  1167.     move.w    #BAD,GSTATUS(a6)
  1168.     jsr    ghostset
  1169.     lea.l    ghost4,a6
  1170.     move.l    #$00c80018,GPOS(a6)
  1171.     move.w    #BAD,GSTATUS(a6)
  1172.     jsr    ghostset
  1173.     move.w    #$c35,col12
  1174.     move.w    #$3c5,col34
  1175.  
  1176.     ; more level ations here
  1177.  
  1178.     move.w    #0,boost    ; boost lost at level completion
  1179.     add.w    #1,difficulty
  1180.     move.w    difficulty,d0    ; choose difficulty
  1181.     cmp.w    #1,d0
  1182.     bne    not_diff1
  1183.     lea.l    ghost1,a6
  1184.     move.w    #1,GSPEED(a6)
  1185.     lea.l    ghost2,a6
  1186.     move.w    #1,GSPEED(a6)
  1187.     lea.l    ghost3,a6
  1188.     move.w    #1,GSPEED(a6)
  1189.     lea.l    ghost4,a6
  1190.     move.w    #1,GSPEED(a6)
  1191.     move.w    #1,pacspeed
  1192.     lea.l    board2,a0
  1193.     jsr    drawboard
  1194.     lea.l    cheese2,a0
  1195.     jsr    initcheese
  1196.     bra    diff_set
  1197. not_diff1:
  1198.     cmp.w    #2,d0
  1199.     bne    not_diff2
  1200.     lea.l    ghost1,a6
  1201.     move.w    #1,GSPEED(a6)
  1202.     lea.l    ghost2,a6
  1203.     move.w    #1,GSPEED(a6)
  1204.     lea.l    ghost3,a6
  1205.     move.w    #1,GSPEED(a6)
  1206.     lea.l    ghost4,a6
  1207.     move.w    #1,GSPEED(a6)
  1208.     move.w    #1,pacspeed
  1209.     lea.l    board3,a0
  1210.     jsr    drawboard
  1211.     lea.l    cheese3,a0
  1212.     jsr    initcheese
  1213.     bra    diff_set
  1214. not_diff2:
  1215.     cmp.w    #3,d0
  1216.     bne    not_diff3
  1217.     lea.l    ghost1,a6
  1218.     move.w    #1,GSPEED(a6)
  1219.     lea.l    ghost2,a6
  1220.     move.w    #1,GSPEED(a6)
  1221.     lea.l    ghost3,a6
  1222.     move.w    #1,GSPEED(a6)
  1223.     lea.l    ghost4,a6
  1224.     move.w    #1,GSPEED(a6)
  1225.     move.w    #1,pacspeed
  1226.     lea.l    board4,a0
  1227.     jsr    drawboard
  1228.     lea.l    cheese4,a0
  1229.     jsr    initcheese
  1230.     bra    diff_set
  1231. not_diff3:
  1232.     cmp.w    #4,d0
  1233.     bne    not_diff4
  1234.     lea.l    ghost1,a6
  1235.     move.w    #1,GSPEED(a6)
  1236.     lea.l    ghost2,a6
  1237.     move.w    #1,GSPEED(a6)
  1238.     lea.l    ghost3,a6
  1239.     move.w    #1,GSPEED(a6)
  1240.     lea.l    ghost4,a6
  1241.     move.w    #1,GSPEED(a6)
  1242.     move.w    #1,pacspeed
  1243.     lea.l    board5,a0
  1244.     jsr    drawboard
  1245.     lea.l    cheese5,a0
  1246.     jsr    initcheese
  1247.     bra    diff_set
  1248. not_diff4:
  1249.     cmp.w    #5,d0
  1250.     bne    not_diff5
  1251.     lea.l    ghost1,a6
  1252.     move.w    #2,GSPEED(a6)
  1253.     lea.l    ghost2,a6
  1254.     move.w    #2,GSPEED(a6)
  1255.     lea.l    ghost3,a6
  1256.     move.w    #2,GSPEED(a6)
  1257.     lea.l    ghost4,a6
  1258.     move.w    #2,GSPEED(a6)
  1259.     move.w    #2,pacspeed
  1260.     lea.l    board1,a0
  1261.     jsr    drawboard
  1262.     lea.l    cheese1,a0
  1263.     jsr    initcheese
  1264.     bra    diff_set
  1265. not_diff5:
  1266.     cmp.w    #6,d0
  1267.     bne    not_diff6
  1268.     lea.l    ghost1,a6
  1269.     move.w    #2,GSPEED(a6)
  1270.     lea.l    ghost2,a6
  1271.     move.w    #2,GSPEED(a6)
  1272.     lea.l    ghost3,a6
  1273.     move.w    #2,GSPEED(a6)
  1274.     lea.l    ghost4,a6
  1275.     move.w    #2,GSPEED(a6)
  1276.     move.w    #2,pacspeed
  1277.     lea.l    board2,a0
  1278.     jsr    drawboard
  1279.     lea.l    cheese2,a0
  1280.     jsr    initcheese
  1281.     bra    diff_set
  1282. not_diff6:
  1283.     cmp.w    #7,d0
  1284.     bne    not_diff7
  1285.     lea.l    ghost1,a6
  1286.     move.w    #2,GSPEED(a6)
  1287.     lea.l    ghost2,a6
  1288.     move.w    #2,GSPEED(a6)
  1289.     lea.l    ghost3,a6
  1290.     move.w    #2,GSPEED(a6)
  1291.     lea.l    ghost4,a6
  1292.     move.w    #2,GSPEED(a6)
  1293.     move.w    #2,pacspeed
  1294.     lea.l    board3,a0
  1295.     jsr    drawboard
  1296.     lea.l    cheese3,a0
  1297.     jsr    initcheese
  1298.     bra    diff_set
  1299. not_diff7:
  1300.     cmp.w    #8,d0
  1301.     bne    not_diff8
  1302.     lea.l    ghost1,a6
  1303.     move.w    #2,GSPEED(a6)
  1304.     lea.l    ghost2,a6
  1305.     move.w    #2,GSPEED(a6)
  1306.     lea.l    ghost3,a6
  1307.     move.w    #2,GSPEED(a6)
  1308.     lea.l    ghost4,a6
  1309.     move.w    #2,GSPEED(a6)
  1310.     move.w    #2,pacspeed
  1311.     lea.l    board4,a0
  1312.     jsr    drawboard
  1313.     lea.l    cheese4,a0
  1314.     jsr    initcheese
  1315.     bra    diff_set
  1316. not_diff8:
  1317.     cmp.w    #9,d0
  1318.     bne    not_diff9
  1319.     lea.l    ghost1,a6
  1320.     move.w    #2,GSPEED(a6)
  1321.     lea.l    ghost2,a6
  1322.     move.w    #2,GSPEED(a6)
  1323.     lea.l    ghost3,a6
  1324.     move.w    #2,GSPEED(a6)
  1325.     lea.l    ghost4,a6
  1326.     move.w    #2,GSPEED(a6)
  1327.     move.w    #2,pacspeed
  1328.     lea.l    board5,a0
  1329.     jsr    drawboard
  1330.     lea.l    cheese5,a0
  1331.     jsr    initcheese
  1332.     bra    diff_set
  1333. not_diff9:
  1334.     cmp.w    #10,d0
  1335.     bne    not_diff10
  1336.     lea.l    ghost1,a6
  1337.     move.w    #4,GSPEED(a6)
  1338.     lea.l    ghost2,a6
  1339.     move.w    #2,GSPEED(a6)
  1340.     lea.l    ghost3,a6
  1341.     move.w    #4,GSPEED(a6)
  1342.     lea.l    ghost4,a6
  1343.     move.w    #2,GSPEED(a6)
  1344.     move.w    #2,pacspeed
  1345.     lea.l    board1,a0
  1346.     jsr    drawboard
  1347.     lea.l    cheese1,a0
  1348.     jsr    initcheese
  1349.     bra    diff_set
  1350. not_diff10:
  1351.     lea.l    ghost1,a6
  1352.     move.w    #4,GSPEED(a6)
  1353.     lea.l    ghost2,a6
  1354.     move.w    #4,GSPEED(a6)
  1355.     lea.l    ghost3,a6
  1356.     move.w    #4,GSPEED(a6)
  1357.     lea.l    ghost4,a6
  1358.     move.w    #4,GSPEED(a6)
  1359.     move.w    #2,pacspeed
  1360.     lea.l    board2,a0
  1361.     jsr    drawboard
  1362.     lea.l    cheese2,a0
  1363.     jsr    initcheese
  1364.     bra    diff_set
  1365. diff_set:
  1366.     jsr    congratulations
  1367.     jsr    hundredpoints    ; 100 is really 1,000
  1368.     jsr    printscore
  1369.     jsr    getready
  1370.     jsr    go
  1371.     rts
  1372.  
  1373. onepoint:
  1374.     lea.l    onept+4,a0
  1375.     bra    setscore
  1376. fivepoints:
  1377.     lea.l    fivept+4,a0
  1378.     bra    setscore
  1379. tenpoints:
  1380.     lea.l    tenpt+4,a0
  1381.     bra    setscore
  1382. hundredpoints:
  1383.     lea.l    hundredpt+4,a0
  1384. setscore:
  1385.     lea.l    score+4,a1
  1386.     move    #0,ccr
  1387.     abcd    -(a0),-(a1)
  1388.     abcd    -(a0),-(a1)
  1389.     abcd    -(a0),-(a1)
  1390.     abcd    -(a0),-(a1)
  1391.     rts
  1392. calculatehiscore:
  1393.     move.l    score,d0
  1394.     move.l    hiscore,d1
  1395.     cmp.l    d1,d0
  1396.     bge    newhiscore
  1397.     rts
  1398. newhiscore:
  1399.     move.l    d0,hiscore
  1400.     rts
  1401.  
  1402. printhiscore:
  1403.     lea.l    digits,a0
  1404.     lea.l    infomsgs,a2
  1405.     add.l    #22+[40*112],a2
  1406.     moveq    #0,d0
  1407.     move.b    hiscore,d0
  1408.     lsr.w    #4,d0
  1409.     bsr.l    printletter
  1410.     moveq    #0,d0
  1411.     move.b    hiscore,d0
  1412.     and.w    #$0f,d0
  1413.     bsr.l    printletter
  1414.     moveq    #0,d0
  1415.     move.b    hiscore+1,d0
  1416.     lsr.w    #4,d0
  1417.     bsr.l    printletter
  1418.     moveq    #0,d0
  1419.     move.b    hiscore+1,d0
  1420.     and.w    #$0f,d0
  1421.     bsr.l    printletter
  1422.     moveq    #0,d0
  1423.     move.b    hiscore+2,d0
  1424.     lsr.w    #4,d0
  1425.     bsr.l    printletter
  1426.     moveq    #0,d0
  1427.     move.b    hiscore+2,d0
  1428.     and.w    #$0f,d0
  1429.     bsr.l    printletter
  1430.     moveq    #0,d0
  1431.     move.b    hiscore+3,d0
  1432.     lsr.w    #4,d0
  1433.     bsr.l    printletter
  1434.     moveq    #0,d0
  1435.     move.b    hiscore+3,d0
  1436.     and.w    #$0f,d0
  1437.     bsr.l    printletter
  1438.     rts
  1439.  
  1440. printscore:
  1441.     lea.l    digits,a0
  1442.     lea.l    scoreboard,a2
  1443.     add.l    #12,a2
  1444.     moveq    #0,d0
  1445.     move.b    score,d0
  1446.     lsr.w    #4,d0
  1447.     bsr.L    printletter
  1448.     moveq    #0,d0
  1449.     move.b    score,d0
  1450.     and.w    #$0f,d0
  1451.     bsr.L    printletter
  1452.     moveq    #0,d0
  1453.     move.b    score+1,d0
  1454.     lsr.w    #4,d0
  1455.     bsr.L    printletter
  1456.     moveq    #0,d0
  1457.     move.b    score+1,d0
  1458.     and.w    #$0f,d0
  1459.     bsr.L    printletter
  1460.     moveq    #0,d0
  1461.     move.b    score+2,d0    
  1462.     lsr.w    #4,d0
  1463.     bsr.s    printletter
  1464.     moveq    #0,d0
  1465.     move.b    score+2,d0
  1466.     and.w    #$0f,d0
  1467.     bsr.s    printletter
  1468.     moveq    #0,d0
  1469.     move.b    score+3,d0
  1470.     lsr.w    #4,d0
  1471.     bsr.s    printletter
  1472.     moveq    #0,d0
  1473.     move.b    score+3,d0
  1474.     and.w    #$0f,d0
  1475.     bsr.s    printletter
  1476.     rts
  1477.  
  1478. updatelives:
  1479.     lea.l    scoreboard,a2
  1480.     lea.l    digits,a0
  1481.     add.l    #38,a2
  1482.     moveq    #0,d0
  1483.     move.b    lives,d0
  1484.     and.w    #$0f,d0
  1485.     bsr.s    printletter
  1486.     rts
  1487.  
  1488. printletter:
  1489.     add.w    d0,d0
  1490.     move.l    a0,a1
  1491.     add.w    d0,a1
  1492.     move.w    #15,d7
  1493. sc1stloop:
  1494.     add.w    #40,a1
  1495.     add.w    #40,a2
  1496.     move.w    (a1),(a2)
  1497.     dbra    d7,sc1stloop
  1498.     sub.l    #640,a2
  1499.     add.l    #2,a2    
  1500.     rts
  1501.  
  1502. getready:
  1503.     jsr    initsprite
  1504.     lea.l    infomsgs,a0
  1505.     lea.l    infoscreen,a1
  1506.     add.l    #48*40,a0    ; get ready offset
  1507.     add.l    #4480,a1    ; position on screen
  1508.     move.l    #$dff000,a6
  1509.     move.w    #100,d7
  1510. getdll:            ; print image and wait...
  1511.     jsr    waitblit
  1512.     move.l     a0,$50(a6)    ; A kanal peker
  1513.     move.l     a1,$54(a6)    ; D kanal peker
  1514.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1515.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1516.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1517.     move.w  #$09f0,$40(a6)    ; blitcon0
  1518.     move.w     #$0000,$42(a6)    ; blitcon1
  1519.     move.w     #64*16+20,$58(a6)    ; blitsize
  1520.     jsr    vblank
  1521.     dbra    d7,getdll
  1522.     jsr    clearinfo
  1523.     rts
  1524.  
  1525. go:
  1526.     lea.l    infomsgs,a0
  1527.     lea.l    infoscreen,a1
  1528.     add.l    #64*40,a0    ; go offset
  1529.     add.l    #4480,a1    ; position on screen
  1530.     move.l    #$dff000,a6
  1531.     move.w    #10,d7
  1532. godll:
  1533.     jsr    waitblit
  1534.     move.l     a0,$50(a6)    ; A kanal peker
  1535.     move.l     a1,$54(a6)    ; D kanal peker
  1536.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1537.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1538.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1539.     move.w  #$09f0,$40(a6)    ; blitcon0
  1540.     move.w     #$0000,$42(a6)    ; blitcon1
  1541.     move.w     #64*16+20,$58(a6)    ; blitsize
  1542.     jsr    vblank
  1543.     dbra    d7,godll
  1544.     jsr    clearinfo
  1545.     rts
  1546.  
  1547. highscore:
  1548.     lea.l    infomsgs,a0
  1549.     lea.l    infoscreen,a1
  1550.     add.l    #112*40,a0    ; go offset
  1551.     ;add.l    #224*40,a1
  1552.     move.l    #$dff000,a6
  1553.     jsr    waitblit
  1554.     move.l     a0,$50(a6)    ; A kanal peker
  1555.     move.l     a1,$54(a6)    ; D kanal peker
  1556.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1557.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1558.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1559.     move.w  #$09f0,$40(a6)    ; blitcon0
  1560.     move.w     #$0000,$42(a6)    ; blitcon1
  1561.     move.w     #64*16+20,$58(a6)    ; blitsize
  1562.     rts
  1563.  
  1564. snackman:
  1565.     lea.l    infomsgs,a0
  1566.     lea.l    infoscreen,a1
  1567.     add.l    #[16*40],a1
  1568.     add.l    #128*40,a0    ; go offset
  1569.     move.l    #$dff000,a6
  1570.     jsr    waitblit
  1571.     move.l     a0,$50(a6)    ; A kanal peker
  1572.     move.l     a1,$54(a6)    ; D kanal peker
  1573.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1574.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1575.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1576.     move.w  #$09f0,$40(a6)    ; blitcon0
  1577.     move.w     #$0000,$42(a6)    ; blitcon1
  1578.     move.w     #64*96+20,$58(a6)    ; blitsize
  1579.     rts
  1580.  
  1581. credits:
  1582.     lea.l    infomsgs,a0
  1583.     lea.l    infoscreen,a1
  1584.     add.l    #144*40,a1
  1585.     add.l    #224*40,a0    ; go offset
  1586.     move.l    #$dff000,a6
  1587.     jsr    waitblit
  1588.     move.l     a0,$50(a6)    ; A kanal peker
  1589.     move.l     a1,$54(a6)    ; D kanal peker
  1590.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1591.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1592.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1593.     move.w  #$09f0,$40(a6)    ; blitcon0
  1594.     move.w     #$0000,$42(a6)    ; blitcon1
  1595.     move.w     #64*64+20,$58(a6)    ; blitsize
  1596.     rts
  1597.  
  1598. congratulations:
  1599.     jsr    initsprite
  1600.     lea.l    infomsgs,a0
  1601.     lea.l    infoscreen,a1
  1602.     add.l    #0*40,a0    ; congratulations offset
  1603.     add.l    #4160,a1    ; position on screen
  1604.     move.l    #$dff000,a6
  1605.     move.w    #150,d7
  1606. congdll:
  1607.     jsr    waitblit
  1608.     move.l     a0,$50(a6)    ; A kanal peker
  1609.     move.l     a1,$54(a6)    ; D kanal peker
  1610.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1611.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1612.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1613.     move.w  #$09f0,$40(a6)    ; blitcon0
  1614.     move.w     #$0000,$42(a6)    ; blitcon1
  1615.     move.w     #64*32+20,$58(a6)    ; blitsize
  1616.     jsr    vblank
  1617.     dbra    d7,congdll
  1618.     jsr    clearinfo
  1619.     rts
  1620.  
  1621. gotyou:
  1622.     jsr    initsprite
  1623.     lea.l    infomsgs,a0
  1624.     lea.l    infoscreen,a1
  1625.     add.l    #32*40,a0    ; congratulations offset
  1626.     add.l    #4480,a1    ; position on screen
  1627.     move.l    #$dff000,a6
  1628.     move.w    #150,d7
  1629. gotyoudll:
  1630.     jsr    waitblit
  1631.     move.l     a0,$50(a6)    ; A kanal peker
  1632.     move.l     a1,$54(a6)    ; D kanal peker
  1633.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1634.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1635.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1636.     move.w  #$09f0,$40(a6)    ; blitcon0
  1637.     move.w     #$0000,$42(a6)    ; blitcon1
  1638.     move.w     #64*16+20,$58(a6)    ; blitsize
  1639.     jsr    vblank
  1640.     dbra    d7,gotyoudll
  1641.     jsr    clearinfo
  1642.     rts
  1643.  
  1644. gameover:
  1645.     jsr    calculatehiscore
  1646.     jsr    printhiscore
  1647.     jsr    highscore
  1648.     jsr    snackman
  1649.     jsr    credits
  1650.     move.w    #$540,cheesecolor
  1651.     lea.l    board1,a0
  1652.     jsr    drawboard
  1653.     lea.l    cheese1,a0
  1654.     jsr    initcheese
  1655.  
  1656.     moveq    #0,d5
  1657. goloop:
  1658.     jsr    vblank
  1659.     jsr    doscroller
  1660.     jsr    scrollertoscreen
  1661.     lea.l    infomsgs,a0
  1662.     lea.l    infoscreen,a1
  1663.     add.l    #80*40,a0
  1664.     add.l    #112*40,a1    
  1665.     lea.l    $dff000,a6
  1666.     add.l    #1,d5
  1667.     btst    #4,d5
  1668.     beq    clearit    
  1669.     jsr    waitblit
  1670.     move.l     a0,$50(a6)    ; A kanal peker
  1671.     move.l     a1,$54(a6)    ; D kanal peker
  1672.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1673.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1674.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1675.     move.w  #$09f0,$40(a6)    ; blitcon0
  1676.     move.w     #$0000,$42(a6)    ; blitcon1
  1677.     move.w     #64*32+20,$58(a6)    ; blitsize
  1678.     bra    waitforpress
  1679. clearit:
  1680.     jsr    waitblit
  1681.     move.l     a1,$54(a6)    ; D kanal peker
  1682.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1683.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1684.     move.w  #$0100,$40(a6)    ; blitcon0
  1685.     move.w     #$0000,$42(a6)    ; blitcon1
  1686.     move.w     #64*32+20,$58(a6)    ; blitsize
  1687. waitforpress:
  1688.     btst    #6,$bfe001
  1689.     beq    terminate
  1690.     btst    #7,$bfe001
  1691.     bne    goloop
  1692.  
  1693.     jsr    initsprite
  1694.     jsr    initcollision
  1695.  
  1696.     move.w    #$a90,cheesecolor
  1697.     move.b    #STARTLIVES,lives    
  1698.     move.l    #$00000000,score
  1699.     move.w    #0,difficulty
  1700.     move.w    #STARTSPEED,pacspeed
  1701.             ; set start difficulty
  1702.     lea.l    ghost1,a6
  1703.     move.w    #1,GSPEED(a6)
  1704.     move.l    #$00380018,GPOS(a6)
  1705.     lea.l    ghost2,a6
  1706.     move.w    #1,GSPEED(a6)
  1707.     move.l    #$00680018,GPOS(a6)
  1708.     lea.l    ghost3,a6
  1709.     move.w    #1,GSPEED(a6)
  1710.     move.l    #$00980018,GPOS(a6)
  1711.     lea.l    ghost4,a6
  1712.     move.w    #1,GSPEED(a6)
  1713.     move.l    #$00c80018,GPOS(a6)
  1714.     move.w    #1,pacspeed
  1715.  
  1716.     jsr    clearinfo
  1717.     jsr    getready
  1718.     jsr    go
  1719. terminate:
  1720.     rts
  1721.  
  1722. newletter:
  1723.     move.l    scrptr,a0
  1724.     move.b    (a0),d0
  1725.     bne.s    doletter
  1726.     lea.l    scrtxt,a0
  1727.     move.l    a0,scrptr
  1728.     move.b    (a0),d0
  1729. doletter:
  1730.     add.l    #1,scrptr
  1731.     lea.l    font8x8,a1
  1732.     sub.b    #32,d0
  1733.     and.w    #$00ff,d0
  1734.     add.w    d0,a1
  1735.     lea.l    scrmem,a2
  1736.     add.l    #39,a2
  1737.     move.w    #6,d2
  1738. doltrloop:
  1739.     move.b    (a1),(a2)
  1740.     add.w    #100,a1
  1741.     add.w    #40,a2
  1742.     dbra    d2,doltrloop
  1743.     rts
  1744.  
  1745. shiftscrleft:
  1746.     lea.l    scrmem,a0
  1747.     add.l    #40*7,a0
  1748.     move.l    #$dff000,a6
  1749.     jsr    waitblit
  1750.     move.l     a0,$50(a6)    ; A kanal peker
  1751.     move.l     a0,$54(a6)    ; D kanal peker
  1752.     move.w     #00,$64(a6)    ; modulo i bytes A kanal
  1753.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1754.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1755.     move.w  #$29f0,$40(a6)    ; blitcon0 - pixel shift
  1756.     move.w     #$0002,$42(a6)    ; blitcon1 - descending mode
  1757.     move.w     #64*7+20,$58(a6)    ; blitsize
  1758.     rts
  1759.  
  1760. doscroller:
  1761.     move.w    scrcounter,d0
  1762.     and.w    #$3,d0
  1763.     bne    nonewltr
  1764.     jsr    newletter
  1765. nonewltr:
  1766.     jsr    shiftscrleft
  1767.     add.w    #1,scrcounter
  1768.     rts
  1769.  
  1770. scrollertoscreen:
  1771.     lea.l    scrmem,a0
  1772.     add.l    #2,a0
  1773.     lea.l    infoscreen,a1
  1774.     add.l    #228*40+2,a1
  1775.     move.l    #$dff000,a6
  1776.     jsr    waitblit
  1777.     move.l     a0,$50(a6)    ; A kanal peker
  1778.     move.l     a1,$54(a6)    ; D kanal peker
  1779.     move.w     #04,$64(a6)    ; modulo i bytes A kanal
  1780.     move.w     #04,$66(a6)    ; modulo i bytes D kanal
  1781.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1782.     move.w  #$09f0,$40(a6)    ; blitcon0
  1783.     move.w     #$0000,$42(a6)    ; blitcon1
  1784.     move.w     #64*8+18,$58(a6)    ; blitsize
  1785.     rts
  1786.  
  1787. clearinfo:
  1788.     lea.l    $dff000,a6
  1789.     jsr    waitblit
  1790.     move.l     #infoscreen,$54(a6)    ; D kanal peker
  1791.     move.w     #00,$66(a6)    ; modulo i bytes D kanal
  1792.     move.l     #$ffffffff,$44(a6) ; blitter a mask
  1793.     move.w  #$0100,$40(a6)    ; blitcon0
  1794.     move.w     #$0000,$42(a6)    ; blitcon1
  1795.     move.w     #64*256+20,$58(a6)    ; blitsize
  1796.     jsr    waitblit
  1797.     rts
  1798.  
  1799. jatilef:
  1800.     jsr    initsprite
  1801.     lea.l    efscreen,a0
  1802.     lea.l    ef1h,a1
  1803.     move.l    a0,d0
  1804.     move.w    d0,6(a1)
  1805.     swap    d0
  1806.     move.w    d0,2(a1)
  1807.     swap    d0
  1808.     add.l    #10240,d0
  1809.     add.l    #8,a1
  1810.     move.w    d0,6(a1)
  1811.     swap    d0
  1812.     move.w    d0,2(a1)
  1813.     swap    d0
  1814.     add.l    #10240,d0
  1815.     add.l    #8,a1
  1816.     move.w    d0,6(a1)
  1817.     swap    d0
  1818.     move.w    d0,2(a1)
  1819.  
  1820.     jsr    realblank
  1821.     move.w    #$7fff,$dff096
  1822.     lea.l    efcoplist,a0
  1823.     move.l    a0,$dff080
  1824.     move.w    #0,$dff088
  1825.     move.w    #$8380,$dff096
  1826. jadelay:
  1827.     lea.l    efccol,a2
  1828.     lea.l    efcol,a3
  1829.     move.w    #7,d5
  1830.     jsr    faderoutine
  1831.  
  1832.     btst    #10,$dff016 
  1833.     beq.s    e_nuff
  1834.     bra.s    jadelay
  1835. e_nuff:    
  1836.     lea.l    efccol,a2
  1837.     lea.l    efcol2,a3
  1838.     move.w    #7,d5
  1839.     jsr    faderoutine
  1840.     rts
  1841.  
  1842. introduction:
  1843.     lea.l    board,a0
  1844.     lea.l    intd1h,a1
  1845.     move.l    a0,d0
  1846.     move.w    d0,6(a1)
  1847.     swap    d0
  1848.     move.w    d0,2(a1)
  1849.     swap    d0
  1850.     add.l    #10240,d0
  1851.     add.l    #8,a1
  1852.     move.w    d0,6(a1)
  1853.     swap    d0
  1854.     move.w    d0,2(a1)
  1855.     swap    d0
  1856.     add.l    #10240,d0
  1857.     add.l    #8,a1
  1858.     move.w    d0,6(a1)
  1859.     swap    d0
  1860.     move.w    d0,2(a1)
  1861.     swap    d0
  1862.     add.l    #10240,d0
  1863.     add.l    #8,a1
  1864.     move.w    d0,6(a1)
  1865.     swap    d0
  1866.     move.w    d0,2(a1)
  1867.     swap    d0
  1868.     add.l    #10240,d0
  1869.     add.l    #8,a1
  1870.     move.w    d0,6(a1)
  1871.     swap    d0
  1872.     move.w    d0,2(a1)
  1873.  
  1874.     jsr    realblank
  1875.     move.w    #$7fff,$dff096
  1876.     lea.l    intdcoplist,a0
  1877.     move.l    a0,$dff080
  1878.     move.w    #0,$dff088
  1879.     move.w    #$83c0,$dff096
  1880.  
  1881.     lea.l    introccol,a2
  1882.     lea.l    introcol,a3
  1883.     move.w    #31,d5
  1884.     jsr    faderoutine    ; fadein opening screen
  1885. introdelay:
  1886.     jsr    vblank
  1887.     btst    #7,$bfe001
  1888.     bne    introdelay    ; wait until button is pressed
  1889. continue:    
  1890.     jsr    vblank
  1891.     btst    #7,$bfe001
  1892.     beq    continue    ; wait until button is released
  1893.  
  1894.     lea.l    introccol,a2
  1895.     lea.l    introcol2,a3
  1896.     move.w    #31,d5
  1897.     jsr    faderoutine
  1898.     
  1899.     lea.l    board,a0    ; clear board
  1900.     move.w    #10239,d7
  1901. intclrlp:
  1902.     move.l    #0,(a0)+
  1903.     dbra    d7,intclrlp
  1904.         
  1905.     rts
  1906.  
  1907. faderoutine:
  1908.     move.w    #3,d6
  1909.     mulu.w    d5,d6
  1910. fadeouter:    
  1911.     move.w    #3,fadespeed
  1912. fadeit:
  1913.     jsr    vblank
  1914.     jsr    realblank
  1915.     sub.w    #1,fadespeed
  1916.     bne    fadeit
  1917.  
  1918.     move.l    a2,a0
  1919.     move.l    a3,a1
  1920.     move.w    d5,d7
  1921.  
  1922.     adda.l    #2,a0
  1923. fadeloop:
  1924.     move.w    (a0),d0
  1925.     move.w    (a1)+,d1
  1926.     
  1927.     move.w    d0,d2
  1928.     move.w    d1,d3
  1929.  
  1930.     and.w    #$00f,d2
  1931.     and.w    #$00f,d3
  1932.     cmp.w    d2,d3
  1933.     beq    fadenext
  1934.     ble    fadedown
  1935.     add.w    #$001,d0
  1936.     bra    fadenext    
  1937. fadedown:
  1938.     sub.w    #$001,d0
  1939. fadenext:    
  1940.     move.w    d0,d2
  1941.     move.w    d1,d3
  1942.     and.w    #$0f0,d2
  1943.     and.w    #$0f0,d3
  1944.     cmp.w    d2,d3
  1945.     beq    fadenext2
  1946.     ble    fadedown2
  1947.     add.w    #$010,d0
  1948.     bra    fadenext2
  1949. fadedown2:
  1950.     sub.w    #$010,d0
  1951. fadenext2:
  1952.     move.w    d0,d2
  1953.     move.w    d1,d3
  1954.     and.w    #$f00,d2
  1955.     and.w    #$f00,d3
  1956.     cmp.w    d2,d3
  1957.     beq    fadenext3
  1958.     ble    fadedown3
  1959.     add.w    #$100,d0
  1960.     bra    fadenext3
  1961. fadedown3:
  1962.     sub.w    #$100,d0
  1963. fadenext3:                        
  1964.     move.w    d0,(a0)
  1965.  
  1966.     adda.l    #4,a0
  1967.     dbra    d7,fadeloop
  1968.     dbra    d6,fadeouter
  1969.     rts
  1970. fadespeed:
  1971.     dc.w    0
  1972.     
  1973. ;    **** MUSIC ROUTINE ****
  1974.  
  1975. ;********************************************
  1976. ;* ----- Protracker V1.1B Playroutine ----- *
  1977. ;* Lars "Zap" Hamre/Amiga Freelancers 1991  *
  1978. ;* Bekkeliveien 10, N-2010 STRØMMEN, Norway *
  1979. ;********************************************
  1980.  
  1981. ; VBlank Version 2:
  1982. ; Call mt_init to initialize the routine, then call mt_music on
  1983. ; each vertical blank (50 Hz). To end the song and turn off all
  1984. ; voices, call mt_end.
  1985.  
  1986. ; This playroutine is not very fast, optimized or well commented,
  1987. ; but all the new commands in PT1.1A should work.
  1988. ; If it's not good enough, you'll have to change it yourself.
  1989. ; We'll try to write a faster routine soon...
  1990.  
  1991. ; Changes from V1.0C playroutine:
  1992. ; - Vibrato depth changed to be compatible with Noisetracker 2.0.
  1993. ;   You'll have to double all vib. depths on old PT modules.
  1994. ; - Funk Repeat changed to Invert Loop.
  1995. ; - Period set back earlier when stopping an effect.
  1996.  
  1997. DMAWait = 300 ; Set this as low as possible without losing low notes.
  1998.  
  1999. n_note        EQU    0  ; W
  2000. n_cmd        EQU    2  ; W
  2001. n_cmdlo        EQU    3  ; B
  2002. n_start        EQU    4  ; L
  2003. n_length    EQU    8  ; W
  2004. n_loopstart    EQU    10 ; L
  2005. n_replen    EQU    14 ; W
  2006. n_period    EQU    16 ; W
  2007. n_finetune    EQU    18 ; B
  2008. n_volume    EQU    19 ; B
  2009. n_dmabit    EQU    20 ; W
  2010. n_toneportdirec    EQU    22 ; B
  2011. n_toneportspeed    EQU    23 ; B
  2012. n_wantedperiod    EQU    24 ; W
  2013. n_vibratocmd    EQU    26 ; B
  2014. n_vibratopos    EQU    27 ; B
  2015. n_tremolocmd    EQU    28 ; B
  2016. n_tremolopos    EQU    29 ; B
  2017. n_wavecontrol    EQU    30 ; B
  2018. n_glissfunk    EQU    31 ; B
  2019. n_sampleoffset    EQU    32 ; B
  2020. n_pattpos    EQU    33 ; B
  2021. n_loopcount    EQU    34 ; B
  2022. n_funkoffset    EQU    35 ; B
  2023. n_wavestart    EQU    36 ; L
  2024. n_reallength    EQU    40 ; W
  2025.  
  2026. mt_init    LEA    mt_data,A0
  2027.     MOVE.L    A0,mt_SongDataPtr
  2028.     MOVE.L    A0,A1
  2029.     LEA    952(A1),A1
  2030.     MOVEQ    #127,D0
  2031.     MOVEQ    #0,D1
  2032. mtloop    MOVE.L    D1,D2
  2033.     SUBQ.W    #1,D0
  2034. mtloop2    MOVE.B    (A1)+,D1
  2035.     CMP.B    D2,D1
  2036.     BGT.S    mtloop
  2037.     DBRA    D0,mtloop2
  2038.     ADDQ.B    #1,D2
  2039.             
  2040.     LEA    mt_SampleStarts(PC),A1
  2041.     ASL.L    #8,D2
  2042.     ASL.L    #2,D2
  2043.     ADD.L    #1084,D2
  2044.     ADD.L    A0,D2
  2045.     MOVE.L    D2,A2
  2046.     MOVEQ    #30,D0
  2047. mtloop3    CLR.L    (A2)
  2048.     MOVE.L    A2,(A1)+
  2049.     MOVEQ    #0,D1
  2050.     MOVE.W    42(A0),D1
  2051.     ASL.L    #1,D1
  2052.     ADD.L    D1,A2
  2053.     ADD.L    #30,A0
  2054.     DBRA    D0,mtloop3
  2055.  
  2056.     OR.B    #2,$BFE001
  2057.     MOVE.B    #6,mt_speed
  2058.     CLR.B    mt_counter
  2059.     CLR.B    mt_SongPos
  2060.     CLR.W    mt_PatternPos
  2061. mt_end    CLR.W    $DFF0A8
  2062.     CLR.W    $DFF0B8
  2063.     CLR.W    $DFF0C8
  2064.     CLR.W    $DFF0D8
  2065.     MOVE.W    #$F,$DFF096
  2066.     RTS
  2067.  
  2068. mt_music
  2069.     MOVEM.L    D0-D4/A0-A6,-(SP)
  2070.     ADDQ.B    #1,mt_counter
  2071.     MOVE.B    mt_counter(PC),D0
  2072.     CMP.B    mt_speed(PC),D0
  2073.     BLO.S    mt_NoNewNote
  2074.     CLR.B    mt_counter
  2075.     TST.B    mt_PattDelTime2
  2076.     BEQ.S    mt_GetNewNote
  2077.     BSR.S    mt_NoNewAllChannels
  2078.     BRA    mt_dskip
  2079.  
  2080. mt_NoNewNote
  2081.     BSR.S    mt_NoNewAllChannels
  2082.     BRA    mt_NoNewPosYet
  2083.  
  2084. mt_NoNewAllChannels
  2085.     LEA    $DFF0A0,A5
  2086.     LEA    mt_chan1temp(PC),A6
  2087.     BSR    mt_CheckEfx
  2088.     LEA    $DFF0B0,A5
  2089.     LEA    mt_chan2temp(PC),A6
  2090.     BSR    mt_CheckEfx
  2091.     LEA    $DFF0C0,A5
  2092.     LEA    mt_chan3temp(PC),A6
  2093.     BSR    mt_CheckEfx
  2094.     LEA    $DFF0D0,A5
  2095.     LEA    mt_chan4temp(PC),A6
  2096.     BRA    mt_CheckEfx
  2097.  
  2098. mt_GetNewNote
  2099.     MOVE.L    mt_SongDataPtr(PC),A0
  2100.     LEA    12(A0),A3
  2101.     LEA    952(A0),A2    ;pattpo
  2102.     LEA    1084(A0),A0    ;patterndata
  2103.     MOVEQ    #0,D0
  2104.     MOVEQ    #0,D1
  2105.     MOVE.B    mt_SongPos(PC),D0
  2106.     MOVE.B    (A2,D0.W),D1
  2107.     ASL.L    #8,D1
  2108.     ASL.L    #2,D1
  2109.     ADD.W    mt_PatternPos(PC),D1
  2110.     CLR.W    mt_DMACONtemp
  2111.  
  2112.     LEA    $DFF0A0,A5
  2113.     LEA    mt_chan1temp(PC),A6
  2114.     BSR.S    mt_PlayVoice
  2115.     LEA    $DFF0B0,A5
  2116.     LEA    mt_chan2temp(PC),A6
  2117.     BSR.S    mt_PlayVoice
  2118.     LEA    $DFF0C0,A5
  2119.     LEA    mt_chan3temp(PC),A6
  2120.     BSR.S    mt_PlayVoice
  2121.     LEA    $DFF0D0,A5
  2122.     LEA    mt_chan4temp(PC),A6
  2123.     BSR.S    mt_PlayVoice
  2124.     BRA    mt_SetDMA
  2125.  
  2126. mt_PlayVoice
  2127.     TST.L    (A6)
  2128.     BNE.S    mt_plvskip
  2129.     BSR    mt_PerNop
  2130. mt_plvskip
  2131.     MOVE.L    (A0,D1.L),(A6)
  2132.     ADDQ.L    #4,D1
  2133.     MOVEQ    #0,D2
  2134.     MOVE.B    n_cmd(A6),D2
  2135.     AND.B    #$F0,D2
  2136.     LSR.B    #4,D2
  2137.     MOVE.B    (A6),D0
  2138.     AND.B    #$F0,D0
  2139.     OR.B    D0,D2
  2140.     TST.B    D2
  2141.     BEQ    mt_SetRegs
  2142.     MOVEQ    #0,D3
  2143.     LEA    mt_SampleStarts(PC),A1
  2144.     MOVE    D2,D4
  2145.     SUBQ.L    #1,D2
  2146.     ASL.L    #2,D2
  2147.     MULU    #30,D4
  2148.     MOVE.L    (A1,D2.L),n_start(A6)
  2149.     MOVE.W    (A3,D4.L),n_length(A6)
  2150.     MOVE.W    (A3,D4.L),n_reallength(A6)
  2151.     MOVE.B    2(A3,D4.L),n_finetune(A6)
  2152.     MOVE.B    3(A3,D4.L),n_volume(A6)
  2153.     MOVE.W    4(A3,D4.L),D3 ; Get repeat
  2154.     TST.W    D3
  2155.     BEQ.S    mt_NoLoop
  2156.     MOVE.L    n_start(A6),D2    ; Get start
  2157.     ASL.W    #1,D3
  2158.     ADD.L    D3,D2        ; Add repeat
  2159.     MOVE.L    D2,n_loopstart(A6)
  2160.     MOVE.L    D2,n_wavestart(A6)
  2161.     MOVE.W    4(A3,D4.L),D0    ; Get repeat
  2162.     ADD.W    6(A3,D4.L),D0    ; Add replen
  2163.     MOVE.W    D0,n_length(A6)
  2164.     MOVE.W    6(A3,D4.L),n_replen(A6)    ; Save replen
  2165.     MOVEQ    #0,D0
  2166.     MOVE.B    n_volume(A6),D0
  2167.     MOVE.W    D0,8(A5)    ; Set volume
  2168.     BRA.S    mt_SetRegs
  2169.  
  2170. mt_NoLoop
  2171.     MOVE.L    n_start(A6),D2
  2172.     ADD.L    D3,D2
  2173.     MOVE.L    D2,n_loopstart(A6)
  2174.     MOVE.L    D2,n_wavestart(A6)
  2175.     MOVE.W    6(A3,D4.L),n_replen(A6)    ; Save replen
  2176.     MOVEQ    #0,D0
  2177.     MOVE.B    n_volume(A6),D0
  2178.     MOVE.W    D0,8(A5)    ; Set volume
  2179. mt_SetRegs
  2180.     MOVE.W    (A6),D0
  2181.     AND.W    #$0FFF,D0
  2182.     BEQ    mt_CheckMoreEfx    ; If no note
  2183.     MOVE.W    2(A6),D0
  2184.     AND.W    #$0FF0,D0
  2185.     CMP.W    #$0E50,D0
  2186.     BEQ.S    mt_DoSetFineTune
  2187.     MOVE.B    2(A6),D0
  2188.     AND.B    #$0F,D0
  2189.     CMP.B    #3,D0    ; TonePortamento
  2190.     BEQ.S    mt_ChkTonePorta
  2191.     CMP.B    #5,D0
  2192.     BEQ.S    mt_ChkTonePorta
  2193.     CMP.B    #9,D0    ; Sample Offset
  2194.     BNE.S    mt_SetPeriod
  2195.     BSR    mt_CheckMoreEfx
  2196.     BRA.S    mt_SetPeriod
  2197.  
  2198. mt_DoSetFineTune
  2199.     BSR    mt_SetFineTune
  2200.     BRA.S    mt_SetPeriod
  2201.  
  2202. mt_ChkTonePorta
  2203.     BSR    mt_SetTonePorta
  2204.     BRA    mt_CheckMoreEfx
  2205.  
  2206. mt_SetPeriod
  2207.     MOVEM.L    D0-D1/A0-A1,-(SP)
  2208.     MOVE.W    (A6),D1
  2209.     AND.W    #$0FFF,D1
  2210.     LEA    mt_PeriodTable(PC),A1
  2211.     MOVEQ    #0,D0
  2212.     MOVEQ    #36,D7
  2213. mt_ftuloop
  2214.     CMP.W    (A1,D0.W),D1
  2215.     BHS.S    mt_ftufound
  2216.     ADDQ.L    #2,D0
  2217.     DBRA    D7,mt_ftuloop
  2218. mt_ftufound
  2219.     MOVEQ    #0,D1
  2220.     MOVE.B    n_finetune(A6),D1
  2221.     MULU    #36*2,D1
  2222.     ADD.L    D1,A1
  2223.     MOVE.W    (A1,D0.W),n_period(A6)
  2224.     MOVEM.L    (SP)+,D0-D1/A0-A1
  2225.  
  2226.     MOVE.W    2(A6),D0
  2227.     AND.W    #$0FF0,D0
  2228.     CMP.W    #$0ED0,D0 ; Notedelay
  2229.     BEQ    mt_CheckMoreEfx
  2230.  
  2231.     MOVE.W    n_dmabit(A6),$DFF096
  2232.     BTST    #2,n_wavecontrol(A6)
  2233.     BNE.S    mt_vibnoc
  2234.     CLR.B    n_vibratopos(A6)
  2235. mt_vibnoc
  2236.     BTST    #6,n_wavecontrol(A6)
  2237.     BNE.S    mt_trenoc
  2238.     CLR.B    n_tremolopos(A6)
  2239. mt_trenoc
  2240.     MOVE.L    n_start(A6),(A5)    ; Set start
  2241.     MOVE.W    n_length(A6),4(A5)    ; Set length
  2242.     MOVE.W    n_period(A6),D0
  2243.     MOVE.W    D0,6(A5)        ; Set period
  2244.     MOVE.W    n_dmabit(A6),D0
  2245.     OR.W    D0,mt_DMACONtemp
  2246.     BRA    mt_CheckMoreEfx
  2247.  
  2248. mt_SetDMA
  2249.     MOVE.W    #300,D0
  2250. mt_WaitDMA
  2251.     DBRA    D0,mt_WaitDMA
  2252.     MOVE.W    mt_DMACONtemp(PC),D0
  2253.     OR.W    #$8000,D0
  2254.     MOVE.W    D0,$DFF096
  2255.     MOVE.W    #300,D0
  2256. mt_WaitDMA2
  2257.     DBRA    D0,mt_WaitDMA2
  2258.  
  2259.     LEA    $DFF000,A5
  2260.     LEA    mt_chan4temp(PC),A6
  2261.     MOVE.L    n_loopstart(A6),$D0(A5)
  2262.     MOVE.W    n_replen(A6),$D4(A5)
  2263.     LEA    mt_chan3temp(PC),A6
  2264.     MOVE.L    n_loopstart(A6),$C0(A5)
  2265.     MOVE.W    n_replen(A6),$C4(A5)
  2266.     LEA    mt_chan2temp(PC),A6
  2267.     MOVE.L    n_loopstart(A6),$B0(A5)
  2268.     MOVE.W    n_replen(A6),$B4(A5)
  2269.     LEA    mt_chan1temp(PC),A6
  2270.     MOVE.L    n_loopstart(A6),$A0(A5)
  2271.     MOVE.W    n_replen(A6),$A4(A5)
  2272.  
  2273. mt_dskip
  2274.     ADD.W    #16,mt_PatternPos
  2275.     MOVE.B    mt_PattDelTime,D0
  2276.     BEQ.S    mt_dskc
  2277.     MOVE.B    D0,mt_PattDelTime2
  2278.     CLR.B    mt_PattDelTime
  2279. mt_dskc    TST.B    mt_PattDelTime2
  2280.     BEQ.S    mt_dska
  2281.     SUBQ.B    #1,mt_PattDelTime2
  2282.     BEQ.S    mt_dska
  2283.     SUB.W    #16,mt_PatternPos
  2284. mt_dska    TST.B    mt_PBreakFlag
  2285.     BEQ.S    mt_nnpysk
  2286.     SF    mt_PBreakFlag
  2287.     MOVEQ    #0,D0
  2288.     MOVE.B    mt_PBreakPos(PC),D0
  2289.     CLR.B    mt_PBreakPos
  2290.     LSL.W    #4,D0
  2291.     MOVE.W    D0,mt_PatternPos
  2292. mt_nnpysk
  2293.     CMP.W    #1024,mt_PatternPos
  2294.     BLO.S    mt_NoNewPosYet
  2295. mt_NextPosition    
  2296.     MOVEQ    #0,D0
  2297.     MOVE.B    mt_PBreakPos(PC),D0
  2298.     LSL.W    #4,D0
  2299.     MOVE.W    D0,mt_PatternPos
  2300.     CLR.B    mt_PBreakPos
  2301.     CLR.B    mt_PosJumpFlag
  2302.     ADDQ.B    #1,mt_SongPos
  2303.     AND.B    #$7F,mt_SongPos
  2304.     MOVE.B    mt_SongPos(PC),D1
  2305.     MOVE.L    mt_SongDataPtr(PC),A0
  2306.     CMP.B    950(A0),D1
  2307.     BLO.S    mt_NoNewPosYet
  2308.     CLR.B    mt_SongPos
  2309. mt_NoNewPosYet    
  2310.     TST.B    mt_PosJumpFlag
  2311.     BNE.S    mt_NextPosition
  2312.     MOVEM.L    (SP)+,D0-D4/A0-A6
  2313.     RTS
  2314.  
  2315. mt_CheckEfx
  2316.     BSR    mt_UpdateFunk
  2317.     MOVE.W    n_cmd(A6),D0
  2318.     AND.W    #$0FFF,D0
  2319.     BEQ.S    mt_PerNop
  2320.     MOVE.B    n_cmd(A6),D0
  2321.     AND.B    #$0F,D0
  2322.     BEQ.S    mt_Arpeggio
  2323.     CMP.B    #1,D0
  2324.     BEQ    mt_PortaUp
  2325.     CMP.B    #2,D0
  2326.     BEQ    mt_PortaDown
  2327.     CMP.B    #3,D0
  2328.     BEQ    mt_TonePortamento
  2329.     CMP.B    #4,D0
  2330.     BEQ    mt_Vibrato
  2331.     CMP.B    #5,D0
  2332.     BEQ    mt_TonePlusVolSlide
  2333.     CMP.B    #6,D0
  2334.     BEQ    mt_VibratoPlusVolSlide
  2335.     CMP.B    #$E,D0
  2336.     BEQ    mt_E_Commands
  2337. SetBack    MOVE.W    n_period(A6),6(A5)
  2338.     CMP.B    #7,D0
  2339.     BEQ    mt_Tremolo
  2340.     CMP.B    #$A,D0
  2341.     BEQ    mt_VolumeSlide
  2342. mt_Return2
  2343.     RTS
  2344.  
  2345. mt_PerNop
  2346.     MOVE.W    n_period(A6),6(A5)
  2347.     RTS
  2348.  
  2349. mt_Arpeggio
  2350.     MOVEQ    #0,D0
  2351.     MOVE.B    mt_counter(PC),D0
  2352.     DIVS    #3,D0
  2353.     SWAP    D0
  2354.     CMP.W    #0,D0
  2355.     BEQ.S    mt_Arpeggio2
  2356.     CMP.W    #2,D0
  2357.     BEQ.S    mt_Arpeggio1
  2358.     MOVEQ    #0,D0
  2359.     MOVE.B    n_cmdlo(A6),D0
  2360.     LSR.B    #4,D0
  2361.     BRA.S    mt_Arpeggio3
  2362.  
  2363. mt_Arpeggio1
  2364.     MOVEQ    #0,D0
  2365.     MOVE.B    n_cmdlo(A6),D0
  2366.     AND.B    #15,D0
  2367.     BRA.S    mt_Arpeggio3
  2368.  
  2369. mt_Arpeggio2
  2370.     MOVE.W    n_period(A6),D2
  2371.     BRA.S    mt_Arpeggio4
  2372.  
  2373. mt_Arpeggio3
  2374.     ASL.W    #1,D0
  2375.     MOVEQ    #0,D1
  2376.     MOVE.B    n_finetune(A6),D1
  2377.     MULU    #36*2,D1
  2378.     LEA    mt_PeriodTable(PC),A0
  2379.     ADD.L    D1,A0
  2380.     MOVEQ    #0,D1
  2381.     MOVE.W    n_period(A6),D1
  2382.     MOVEQ    #36,D7
  2383. mt_arploop
  2384.     MOVE.W    (A0,D0.W),D2
  2385.     CMP.W    (A0),D1
  2386.     BHS.S    mt_Arpeggio4
  2387.     ADDQ.L    #2,A0
  2388.     DBRA    D7,mt_arploop
  2389.     RTS
  2390.  
  2391. mt_Arpeggio4
  2392.     MOVE.W    D2,6(A5)
  2393.     RTS
  2394.  
  2395. mt_FinePortaUp
  2396.     TST.B    mt_counter
  2397.     BNE.S    mt_Return2
  2398.     MOVE.B    #$0F,mt_LowMask
  2399. mt_PortaUp
  2400.     MOVEQ    #0,D0
  2401.     MOVE.B    n_cmdlo(A6),D0
  2402.     AND.B    mt_LowMask(PC),D0
  2403.     MOVE.B    #$FF,mt_LowMask
  2404.     SUB.W    D0,n_period(A6)
  2405.     MOVE.W    n_period(A6),D0
  2406.     AND.W    #$0FFF,D0
  2407.     CMP.W    #113,D0
  2408.     BPL.S    mt_PortaUskip
  2409.     AND.W    #$F000,n_period(A6)
  2410.     OR.W    #113,n_period(A6)
  2411. mt_PortaUskip
  2412.     MOVE.W    n_period(A6),D0
  2413.     AND.W    #$0FFF,D0
  2414.     MOVE.W    D0,6(A5)
  2415.     RTS    
  2416.  
  2417. mt_FinePortaDown
  2418.     TST.B    mt_counter
  2419.     BNE    mt_Return2
  2420.     MOVE.B    #$0F,mt_LowMask
  2421. mt_PortaDown
  2422.     CLR.W    D0
  2423.     MOVE.B    n_cmdlo(A6),D0
  2424.     AND.B    mt_LowMask(PC),D0
  2425.     MOVE.B    #$FF,mt_LowMask
  2426.     ADD.W    D0,n_period(A6)
  2427.     MOVE.W    n_period(A6),D0
  2428.     AND.W    #$0FFF,D0
  2429.     CMP.W    #856,D0
  2430.     BMI.S    mt_PortaDskip
  2431.     AND.W    #$F000,n_period(A6)
  2432.     OR.W    #856,n_period(A6)
  2433. mt_PortaDskip
  2434.     MOVE.W    n_period(A6),D0
  2435.     AND.W    #$0FFF,D0
  2436.     MOVE.W    D0,6(A5)
  2437.     RTS
  2438.  
  2439. mt_SetTonePorta
  2440.     MOVE.L    A0,-(SP)
  2441.     MOVE.W    (A6),D2
  2442.     AND.W    #$0FFF,D2
  2443.     MOVEQ    #0,D0
  2444.     MOVE.B    n_finetune(A6),D0
  2445.     MULU    #37*2,D0
  2446.     LEA    mt_PeriodTable(PC),A0
  2447.     ADD.L    D0,A0
  2448.     MOVEQ    #0,D0
  2449. mt_StpLoop
  2450.     CMP.W    (A0,D0.W),D2
  2451.     BHS.S    mt_StpFound
  2452.     ADDQ.W    #2,D0
  2453.     CMP.W    #37*2,D0
  2454.     BLO.S    mt_StpLoop
  2455.     MOVEQ    #35*2,D0
  2456. mt_StpFound
  2457.     MOVE.B    n_finetune(A6),D2
  2458.     AND.B    #8,D2
  2459.     BEQ.S    mt_StpGoss
  2460.     TST.W    D0
  2461.     BEQ.S    mt_StpGoss
  2462.     SUBQ.W    #2,D0
  2463. mt_StpGoss
  2464.     MOVE.W    (A0,D0.W),D2
  2465.     MOVE.L    (SP)+,A0
  2466.     MOVE.W    D2,n_wantedperiod(A6)
  2467.     MOVE.W    n_period(A6),D0
  2468.     CLR.B    n_toneportdirec(A6)
  2469.     CMP.W    D0,D2
  2470.     BEQ.S    mt_ClearTonePorta
  2471.     BGE    mt_Return2
  2472.     MOVE.B    #1,n_toneportdirec(A6)
  2473.     RTS
  2474.  
  2475. mt_ClearTonePorta
  2476.     CLR.W    n_wantedperiod(A6)
  2477.     RTS
  2478.  
  2479. mt_TonePortamento
  2480.     MOVE.B    n_cmdlo(A6),D0
  2481.     BEQ.S    mt_TonePortNoChange
  2482.     MOVE.B    D0,n_toneportspeed(A6)
  2483.     CLR.B    n_cmdlo(A6)
  2484. mt_TonePortNoChange
  2485.     TST.W    n_wantedperiod(A6)
  2486.     BEQ    mt_Return2
  2487.     MOVEQ    #0,D0
  2488.     MOVE.B    n_toneportspeed(A6),D0
  2489.     TST.B    n_toneportdirec(A6)
  2490.     BNE.S    mt_TonePortaUp
  2491. mt_TonePortaDown
  2492.     ADD.W    D0,n_period(A6)
  2493.     MOVE.W    n_wantedperiod(A6),D0
  2494.     CMP.W    n_period(A6),D0
  2495.     BGT.S    mt_TonePortaSetPer
  2496.     MOVE.W    n_wantedperiod(A6),n_period(A6)
  2497.     CLR.W    n_wantedperiod(A6)
  2498.     BRA.S    mt_TonePortaSetPer
  2499.  
  2500. mt_TonePortaUp
  2501.     SUB.W    D0,n_period(A6)
  2502.     MOVE.W    n_wantedperiod(A6),D0
  2503.     CMP.W    n_period(A6),D0
  2504.     BLT.S    mt_TonePortaSetPer
  2505.     MOVE.W    n_wantedperiod(A6),n_period(A6)
  2506.     CLR.W    n_wantedperiod(A6)
  2507.  
  2508. mt_TonePortaSetPer
  2509.     MOVE.W    n_period(A6),D2
  2510.     MOVE.B    n_glissfunk(A6),D0
  2511.     AND.B    #$0F,D0
  2512.     BEQ.S    mt_GlissSkip
  2513.     MOVEQ    #0,D0
  2514.     MOVE.B    n_finetune(A6),D0
  2515.     MULU    #36*2,D0
  2516.     LEA    mt_PeriodTable(PC),A0
  2517.     ADD.L    D0,A0
  2518.     MOVEQ    #0,D0
  2519. mt_GlissLoop
  2520.     CMP.W    (A0,D0.W),D2
  2521.     BHS.S    mt_GlissFound
  2522.     ADDQ.W    #2,D0
  2523.     CMP.W    #36*2,D0
  2524.     BLO.S    mt_GlissLoop
  2525.     MOVEQ    #35*2,D0
  2526. mt_GlissFound
  2527.     MOVE.W    (A0,D0.W),D2
  2528. mt_GlissSkip
  2529.     MOVE.W    D2,6(A5) ; Set period
  2530.     RTS
  2531.  
  2532. mt_Vibrato
  2533.     MOVE.B    n_cmdlo(A6),D0
  2534.     BEQ.S    mt_Vibrato2
  2535.     MOVE.B    n_vibratocmd(A6),D2
  2536.     AND.B    #$0F,D0
  2537.     BEQ.S    mt_vibskip
  2538.     AND.B    #$F0,D2
  2539.     OR.B    D0,D2
  2540. mt_vibskip
  2541.     MOVE.B    n_cmdlo(A6),D0
  2542.     AND.B    #$F0,D0
  2543.     BEQ.S    mt_vibskip2
  2544.     AND.B    #$0F,D2
  2545.     OR.B    D0,D2
  2546. mt_vibskip2
  2547.     MOVE.B    D2,n_vibratocmd(A6)
  2548. mt_Vibrato2
  2549.     MOVE.B    n_vibratopos(A6),D0
  2550.     LEA    mt_VibratoTable(PC),A4
  2551.     LSR.W    #2,D0
  2552.     AND.W    #$001F,D0
  2553.     MOVEQ    #0,D2
  2554.     MOVE.B    n_wavecontrol(A6),D2
  2555.     AND.B    #$03,D2
  2556.     BEQ.S    mt_vib_sine
  2557.     LSL.B    #3,D0
  2558.     CMP.B    #1,D2
  2559.     BEQ.S    mt_vib_rampdown
  2560.     MOVE.B    #255,D2
  2561.     BRA.S    mt_vib_set
  2562. mt_vib_rampdown
  2563.     TST.B    n_vibratopos(A6)
  2564.     BPL.S    mt_vib_rampdown2
  2565.     MOVE.B    #255,D2
  2566.     SUB.B    D0,D2
  2567.     BRA.S    mt_vib_set
  2568. mt_vib_rampdown2
  2569.     MOVE.B    D0,D2
  2570.     BRA.S    mt_vib_set
  2571. mt_vib_sine
  2572.     MOVE.B    0(A4,D0.W),D2
  2573. mt_vib_set
  2574.     MOVE.B    n_vibratocmd(A6),D0
  2575.     AND.W    #15,D0
  2576.     MULU    D0,D2
  2577.     LSR.W    #7,D2
  2578.     MOVE.W    n_period(A6),D0
  2579.     TST.B    n_vibratopos(A6)
  2580.     BMI.S    mt_VibratoNeg
  2581.     ADD.W    D2,D0
  2582.     BRA.S    mt_Vibrato3
  2583. mt_VibratoNeg
  2584.     SUB.W    D2,D0
  2585. mt_Vibrato3
  2586.     MOVE.W    D0,6(A5)
  2587.     MOVE.B    n_vibratocmd(A6),D0
  2588.     LSR.W    #2,D0
  2589.     AND.W    #$003C,D0
  2590.     ADD.B    D0,n_vibratopos(A6)
  2591.     RTS
  2592.  
  2593. mt_TonePlusVolSlide
  2594.     BSR    mt_TonePortNoChange
  2595.     BRA    mt_VolumeSlide
  2596.  
  2597. mt_VibratoPlusVolSlide
  2598.     BSR.S    mt_Vibrato2
  2599.     BRA    mt_VolumeSlide
  2600.  
  2601. mt_Tremolo
  2602.     MOVE.B    n_cmdlo(A6),D0
  2603.     BEQ.S    mt_Tremolo2
  2604.     MOVE.B    n_tremolocmd(A6),D2
  2605.     AND.B    #$0F,D0
  2606.     BEQ.S    mt_treskip
  2607.     AND.B    #$F0,D2
  2608.     OR.B    D0,D2
  2609. mt_treskip
  2610.     MOVE.B    n_cmdlo(A6),D0
  2611.     AND.B    #$F0,D0
  2612.     BEQ.S    mt_treskip2
  2613.     AND.B    #$0F,D2
  2614.     OR.B    D0,D2
  2615. mt_treskip2
  2616.     MOVE.B    D2,n_tremolocmd(A6)
  2617. mt_Tremolo2
  2618.     MOVE.B    n_tremolopos(A6),D0
  2619.     LEA    mt_VibratoTable(PC),A4
  2620.     LSR.W    #2,D0
  2621.     AND.W    #$001F,D0
  2622.     MOVEQ    #0,D2
  2623.     MOVE.B    n_wavecontrol(A6),D2
  2624.     LSR.B    #4,D2
  2625.     AND.B    #$03,D2
  2626.     BEQ.S    mt_tre_sine
  2627.     LSL.B    #3,D0
  2628.     CMP.B    #1,D2
  2629.     BEQ.S    mt_tre_rampdown
  2630.     MOVE.B    #255,D2
  2631.     BRA.S    mt_tre_set
  2632. mt_tre_rampdown
  2633.     TST.B    n_vibratopos(A6)
  2634.     BPL.S    mt_tre_rampdown2
  2635.     MOVE.B    #255,D2
  2636.     SUB.B    D0,D2
  2637.     BRA.S    mt_tre_set
  2638. mt_tre_rampdown2
  2639.     MOVE.B    D0,D2
  2640.     BRA.S    mt_tre_set
  2641. mt_tre_sine
  2642.     MOVE.B    0(A4,D0.W),D2
  2643. mt_tre_set
  2644.     MOVE.B    n_tremolocmd(A6),D0
  2645.     AND.W    #15,D0
  2646.     MULU    D0,D2
  2647.     LSR.W    #6,D2
  2648.     MOVEQ    #0,D0
  2649.     MOVE.B    n_volume(A6),D0
  2650.     TST.B    n_tremolopos(A6)
  2651.     BMI.S    mt_TremoloNeg
  2652.     ADD.W    D2,D0
  2653.     BRA.S    mt_Tremolo3
  2654. mt_TremoloNeg
  2655.     SUB.W    D2,D0
  2656. mt_Tremolo3
  2657.     BPL.S    mt_TremoloSkip
  2658.     CLR.W    D0
  2659. mt_TremoloSkip
  2660.     CMP.W    #$40,D0
  2661.     BLS.S    mt_TremoloOk
  2662.     MOVE.W    #$40,D0
  2663. mt_TremoloOk
  2664.     MOVE.W    D0,8(A5)
  2665.     MOVE.B    n_tremolocmd(A6),D0
  2666.     LSR.W    #2,D0
  2667.     AND.W    #$003C,D0
  2668.     ADD.B    D0,n_tremolopos(A6)
  2669.     RTS
  2670.  
  2671. mt_SampleOffset
  2672.     MOVEQ    #0,D0
  2673.     MOVE.B    n_cmdlo(A6),D0
  2674.     BEQ.S    mt_sononew
  2675.     MOVE.B    D0,n_sampleoffset(A6)
  2676. mt_sononew
  2677.     MOVE.B    n_sampleoffset(A6),D0
  2678.     LSL.W    #7,D0
  2679.     CMP.W    n_length(A6),D0
  2680.     BGE.S    mt_sofskip
  2681.     SUB.W    D0,n_length(A6)
  2682.     LSL.W    #1,D0
  2683.     ADD.L    D0,n_start(A6)
  2684.     RTS
  2685. mt_sofskip
  2686.     MOVE.W    #$0001,n_length(A6)
  2687.     RTS
  2688.  
  2689. mt_VolumeSlide
  2690.     MOVEQ    #0,D0
  2691.     MOVE.B    n_cmdlo(A6),D0
  2692.     LSR.B    #4,D0
  2693.     TST.B    D0
  2694.     BEQ.S    mt_VolSlideDown
  2695. mt_VolSlideUp
  2696.     ADD.B    D0,n_volume(A6)
  2697.     CMP.B    #$40,n_volume(A6)
  2698.     BMI.S    mt_vsuskip
  2699.     MOVE.B    #$40,n_volume(A6)
  2700. mt_vsuskip
  2701.     MOVE.B    n_volume(A6),D0
  2702.     MOVE.W    D0,8(A5)
  2703.     RTS
  2704.  
  2705. mt_VolSlideDown
  2706.     MOVEQ    #0,D0
  2707.     MOVE.B    n_cmdlo(A6),D0
  2708.     AND.B    #$0F,D0
  2709. mt_VolSlideDown2
  2710.     SUB.B    D0,n_volume(A6)
  2711.     BPL.S    mt_vsdskip
  2712.     CLR.B    n_volume(A6)
  2713. mt_vsdskip
  2714.     MOVE.B    n_volume(A6),D0
  2715.     MOVE.W    D0,8(A5)
  2716.     RTS
  2717.  
  2718. mt_PositionJump
  2719.     MOVE.B    n_cmdlo(A6),D0
  2720.     SUBQ.B    #1,D0
  2721.     MOVE.B    D0,mt_SongPos
  2722. mt_pj2    CLR.B    mt_PBreakPos
  2723.     ST     mt_PosJumpFlag
  2724.     RTS
  2725.  
  2726. mt_VolumeChange
  2727.     MOVEQ    #0,D0
  2728.     MOVE.B    n_cmdlo(A6),D0
  2729.     CMP.B    #$40,D0
  2730.     BLS.S    mt_VolumeOk
  2731.     MOVEQ    #$40,D0
  2732. mt_VolumeOk
  2733.     MOVE.B    D0,n_volume(A6)
  2734.     MOVE.W    D0,8(A5)
  2735.     RTS
  2736.  
  2737. mt_PatternBreak
  2738.     MOVEQ    #0,D0
  2739.     MOVE.B    n_cmdlo(A6),D0
  2740.     MOVE.L    D0,D2
  2741.     LSR.B    #4,D0
  2742.     MULU    #10,D0
  2743.     AND.B    #$0F,D2
  2744.     ADD.B    D2,D0
  2745.     CMP.B    #63,D0
  2746.     BHI.S    mt_pj2
  2747.     MOVE.B    D0,mt_PBreakPos
  2748.     ST    mt_PosJumpFlag
  2749.     RTS
  2750.  
  2751. mt_SetSpeed
  2752.     MOVE.B    3(A6),D0
  2753.     BEQ    mt_Return2
  2754.     CLR.B    mt_counter
  2755.     MOVE.B    D0,mt_speed
  2756.     RTS
  2757.  
  2758. mt_CheckMoreEfx
  2759.     BSR    mt_UpdateFunk
  2760.     MOVE.B    2(A6),D0
  2761.     AND.B    #$0F,D0
  2762.     CMP.B    #$9,D0
  2763.     BEQ    mt_SampleOffset
  2764.     CMP.B    #$B,D0
  2765.     BEQ    mt_PositionJump
  2766.     CMP.B    #$D,D0
  2767.     BEQ.S    mt_PatternBreak
  2768.     CMP.B    #$E,D0
  2769.     BEQ.S    mt_E_Commands
  2770.     CMP.B    #$F,D0
  2771.     BEQ.S    mt_SetSpeed
  2772.     CMP.B    #$C,D0
  2773.     BEQ    mt_VolumeChange
  2774.     BRA    mt_PerNop
  2775.  
  2776. mt_E_Commands
  2777.     MOVE.B    n_cmdlo(A6),D0
  2778.     AND.B    #$F0,D0
  2779.     LSR.B    #4,D0
  2780.     BEQ.S    mt_FilterOnOff
  2781.     CMP.B    #1,D0
  2782.     BEQ    mt_FinePortaUp
  2783.     CMP.B    #2,D0
  2784.     BEQ    mt_FinePortaDown
  2785.     CMP.B    #3,D0
  2786.     BEQ.S    mt_SetGlissControl
  2787.     CMP.B    #4,D0
  2788.     BEQ    mt_SetVibratoControl
  2789.     CMP.B    #5,D0
  2790.     BEQ    mt_SetFineTune
  2791.     CMP.B    #6,D0
  2792.     BEQ    mt_JumpLoop
  2793.     CMP.B    #7,D0
  2794.     BEQ    mt_SetTremoloControl
  2795.     CMP.B    #9,D0
  2796.     BEQ    mt_RetrigNote
  2797.     CMP.B    #$A,D0
  2798.     BEQ    mt_VolumeFineUp
  2799.     CMP.B    #$B,D0
  2800.     BEQ    mt_VolumeFineDown
  2801.     CMP.B    #$C,D0
  2802.     BEQ    mt_NoteCut
  2803.     CMP.B    #$D,D0
  2804.     BEQ    mt_NoteDelay
  2805.     CMP.B    #$E,D0
  2806.     BEQ    mt_PatternDelay
  2807.     CMP.B    #$F,D0
  2808.     BEQ    mt_FunkIt
  2809.     RTS
  2810.  
  2811. mt_FilterOnOff
  2812.     MOVE.B    n_cmdlo(A6),D0
  2813.     AND.B    #1,D0
  2814.     ASL.B    #1,D0
  2815.     AND.B    #$FD,$BFE001
  2816.     OR.B    D0,$BFE001
  2817.     RTS    
  2818.  
  2819. mt_SetGlissControl
  2820.     MOVE.B    n_cmdlo(A6),D0
  2821.     AND.B    #$0F,D0
  2822.     AND.B    #$F0,n_glissfunk(A6)
  2823.     OR.B    D0,n_glissfunk(A6)
  2824.     RTS
  2825.  
  2826. mt_SetVibratoControl
  2827.     MOVE.B    n_cmdlo(A6),D0
  2828.     AND.B    #$0F,D0
  2829.     AND.B    #$F0,n_wavecontrol(A6)
  2830.     OR.B    D0,n_wavecontrol(A6)
  2831.     RTS
  2832.  
  2833. mt_SetFineTune
  2834.     MOVE.B    n_cmdlo(A6),D0
  2835.     AND.B    #$0F,D0
  2836.     MOVE.B    D0,n_finetune(A6)
  2837.     RTS
  2838.  
  2839. mt_JumpLoop
  2840.     TST.B    mt_counter
  2841.     BNE    mt_Return2
  2842.     MOVE.B    n_cmdlo(A6),D0
  2843.     AND.B    #$0F,D0
  2844.     BEQ.S    mt_SetLoop
  2845.     TST.B    n_loopcount(A6)
  2846.     BEQ.S    mt_jumpcnt
  2847.     SUBQ.B    #1,n_loopcount(A6)
  2848.     BEQ    mt_Return2
  2849. mt_jmploop    MOVE.B    n_pattpos(A6),mt_PBreakPos
  2850.     ST    mt_PBreakFlag
  2851.     RTS
  2852.  
  2853. mt_jumpcnt
  2854.     MOVE.B    D0,n_loopcount(A6)
  2855.     BRA.S    mt_jmploop
  2856.  
  2857. mt_SetLoop
  2858.     MOVE.W    mt_PatternPos(PC),D0
  2859.     LSR.W    #4,D0
  2860.     MOVE.B    D0,n_pattpos(A6)
  2861.     RTS
  2862.  
  2863. mt_SetTremoloControl
  2864.     MOVE.B    n_cmdlo(A6),D0
  2865.     AND.B    #$0F,D0
  2866.     LSL.B    #4,D0
  2867.     AND.B    #$0F,n_wavecontrol(A6)
  2868.     OR.B    D0,n_wavecontrol(A6)
  2869.     RTS
  2870.  
  2871. mt_RetrigNote
  2872.     MOVE.L    D1,-(SP)
  2873.     MOVEQ    #0,D0
  2874.     MOVE.B    n_cmdlo(A6),D0
  2875.     AND.B    #$0F,D0
  2876.     BEQ.S    mt_rtnend
  2877.     MOVEQ    #0,D1
  2878.     MOVE.B    mt_counter(PC),D1
  2879.     BNE.S    mt_rtnskp
  2880.     MOVE.W    (A6),D1
  2881.     AND.W    #$0FFF,D1
  2882.     BNE.S    mt_rtnend
  2883.     MOVEQ    #0,D1
  2884.     MOVE.B    mt_counter(PC),D1
  2885. mt_rtnskp
  2886.     DIVU    D0,D1
  2887.     SWAP    D1
  2888.     TST.W    D1
  2889.     BNE.S    mt_rtnend
  2890. mt_DoRetrig
  2891.     MOVE.W    n_dmabit(A6),$DFF096    ; Channel DMA off
  2892.     MOVE.L    n_start(A6),(A5)    ; Set sampledata pointer
  2893.     MOVE.W    n_length(A6),4(A5)    ; Set length
  2894.     MOVE.W    #300,D0
  2895. mt_rtnloop1
  2896.     DBRA    D0,mt_rtnloop1
  2897.     MOVE.W    n_dmabit(A6),D0
  2898.     BSET    #15,D0
  2899.     MOVE.W    D0,$DFF096
  2900.     MOVE.W    #300,D0
  2901. mt_rtnloop2
  2902.     DBRA    D0,mt_rtnloop2
  2903.     MOVE.L    n_loopstart(A6),(A5)
  2904.     MOVE.L    n_replen(A6),4(A5)
  2905. mt_rtnend
  2906.     MOVE.L    (SP)+,D1
  2907.     RTS
  2908.  
  2909. mt_VolumeFineUp
  2910.     TST.B    mt_counter
  2911.     BNE    mt_Return2
  2912.     MOVEQ    #0,D0
  2913.     MOVE.B    n_cmdlo(A6),D0
  2914.     AND.B    #$F,D0
  2915.     BRA    mt_VolSlideUp
  2916.  
  2917. mt_VolumeFineDown
  2918.     TST.B    mt_counter
  2919.     BNE    mt_Return2
  2920.     MOVEQ    #0,D0
  2921.     MOVE.B    n_cmdlo(A6),D0
  2922.     AND.B    #$0F,D0
  2923.     BRA    mt_VolSlideDown2
  2924.  
  2925. mt_NoteCut
  2926.     MOVEQ    #0,D0
  2927.     MOVE.B    n_cmdlo(A6),D0
  2928.     AND.B    #$0F,D0
  2929.     CMP.B    mt_counter(PC),D0
  2930.     BNE    mt_Return2
  2931.     CLR.B    n_volume(A6)
  2932.     MOVE.W    #0,8(A5)
  2933.     RTS
  2934.  
  2935. mt_NoteDelay
  2936.     MOVEQ    #0,D0
  2937.     MOVE.B    n_cmdlo(A6),D0
  2938.     AND.B    #$0F,D0
  2939.     CMP.B    mt_Counter,D0
  2940.     BNE    mt_Return2
  2941.     MOVE.W    (A6),D0
  2942.     BEQ    mt_Return2
  2943.     MOVE.L    D1,-(SP)
  2944.     BRA    mt_DoRetrig
  2945.  
  2946. mt_PatternDelay
  2947.     TST.B    mt_counter
  2948.     BNE    mt_Return2
  2949.     MOVEQ    #0,D0
  2950.     MOVE.B    n_cmdlo(A6),D0
  2951.     AND.B    #$0F,D0
  2952.     TST.B    mt_PattDelTime2
  2953.     BNE    mt_Return2
  2954.     ADDQ.B    #1,D0
  2955.     MOVE.B    D0,mt_PattDelTime
  2956.     RTS
  2957.  
  2958. mt_FunkIt
  2959.     TST.B    mt_counter
  2960.     BNE    mt_Return2
  2961.     MOVE.B    n_cmdlo(A6),D0
  2962.     AND.B    #$0F,D0
  2963.     LSL.B    #4,D0
  2964.     AND.B    #$0F,n_glissfunk(A6)
  2965.     OR.B    D0,n_glissfunk(A6)
  2966.     TST.B    D0
  2967.     BEQ    mt_Return2
  2968. mt_UpdateFunk
  2969.     MOVEM.L    D1/A0,-(SP)
  2970.     MOVEQ    #0,D0
  2971.     MOVE.B    n_glissfunk(A6),D0
  2972.     LSR.B    #4,D0
  2973.     BEQ.S    mt_funkend
  2974.     LEA    mt_FunkTable(PC),A0
  2975.     MOVE.B    (A0,D0.W),D0
  2976.     ADD.B    D0,n_funkoffset(A6)
  2977.     BTST    #7,n_funkoffset(A6)
  2978.     BEQ.S    mt_funkend
  2979.     CLR.B    n_funkoffset(A6)
  2980.  
  2981.     MOVE.L    n_loopstart(A6),D0
  2982.     MOVEQ    #0,D1
  2983.     MOVE.W    n_replen(A6),D1
  2984.     ADD.L    D1,D0
  2985.     ADD.L    D1,D0
  2986.     MOVE.L    n_wavestart(A6),A0
  2987.     ADDQ.L    #1,A0
  2988.     CMP.L    D0,A0
  2989.     BLO.S    mt_funkok
  2990.     MOVE.L    n_loopstart(A6),A0
  2991. mt_funkok
  2992.     MOVE.L    A0,n_wavestart(A6)
  2993.     MOVEQ    #-1,D0
  2994.     SUB.B    (A0),D0
  2995.     MOVE.B    D0,(A0)
  2996. mt_funkend
  2997.     MOVEM.L    (SP)+,D1/A0
  2998.     RTS
  2999.  
  3000.  
  3001. mt_FunkTable dc.b 0,5,6,7,8,10,11,13,16,19,22,26,32,43,64,128
  3002.  
  3003. mt_VibratoTable    
  3004.     dc.b   0, 24, 49, 74, 97,120,141,161
  3005.     dc.b 180,197,212,224,235,244,250,253
  3006.     dc.b 255,253,250,244,235,224,212,197
  3007.     dc.b 180,161,141,120, 97, 74, 49, 24
  3008.  
  3009. mt_PeriodTable
  3010. ; Tuning 0, Normal
  3011.     dc.w    856,808,762,720,678,640,604,570,538,508,480,453
  3012.     dc.w    428,404,381,360,339,320,302,285,269,254,240,226
  3013.     dc.w    214,202,190,180,170,160,151,143,135,127,120,113
  3014. ; Tuning 1
  3015.     dc.w    850,802,757,715,674,637,601,567,535,505,477,450
  3016.     dc.w    425,401,379,357,337,318,300,284,268,253,239,225
  3017.     dc.w    213,201,189,179,169,159,150,142,134,126,119,113
  3018. ; Tuning 2
  3019.     dc.w    844,796,752,709,670,632,597,563,532,502,474,447
  3020.     dc.w    422,398,376,355,335,316,298,282,266,251,237,224
  3021.     dc.w    211,199,188,177,167,158,149,141,133,125,118,112
  3022. ; Tuning 3
  3023.     dc.w    838,791,746,704,665,628,592,559,528,498,470,444
  3024.     dc.w    419,395,373,352,332,314,296,280,264,249,235,222
  3025.     dc.w    209,198,187,176,166,157,148,140,132,125,118,111
  3026. ; Tuning 4
  3027.     dc.w    832,785,741,699,660,623,588,555,524,495,467,441
  3028.     dc.w    416,392,370,350,330,312,294,278,262,247,233,220
  3029.     dc.w    208,196,185,175,165,156,147,139,131,124,117,110
  3030. ; Tuning 5
  3031.     dc.w    826,779,736,694,655,619,584,551,520,491,463,437
  3032.     dc.w    413,390,368,347,328,309,292,276,260,245,232,219
  3033.     dc.w    206,195,184,174,164,155,146,138,130,123,116,109
  3034. ; Tuning 6
  3035.     dc.w    820,774,730,689,651,614,580,547,516,487,460,434
  3036.     dc.w    410,387,365,345,325,307,290,274,258,244,230,217
  3037.     dc.w    205,193,183,172,163,154,145,137,129,122,115,109
  3038. ; Tuning 7
  3039.     dc.w    814,768,725,684,646,610,575,543,513,484,457,431
  3040.     dc.w    407,384,363,342,323,305,288,272,256,242,228,216
  3041.     dc.w    204,192,181,171,161,152,144,136,128,121,114,108
  3042. ; Tuning -8
  3043.     dc.w    907,856,808,762,720,678,640,604,570,538,508,480
  3044.     dc.w    453,428,404,381,360,339,320,302,285,269,254,240
  3045.     dc.w    226,214,202,190,180,170,160,151,143,135,127,120
  3046. ; Tuning -7
  3047.     dc.w    900,850,802,757,715,675,636,601,567,535,505,477
  3048.     dc.w    450,425,401,379,357,337,318,300,284,268,253,238
  3049.     dc.w    225,212,200,189,179,169,159,150,142,134,126,119
  3050. ; Tuning -6
  3051.     dc.w    894,844,796,752,709,670,632,597,563,532,502,474
  3052.     dc.w    447,422,398,376,355,335,316,298,282,266,251,237
  3053.     dc.w    223,211,199,188,177,167,158,149,141,133,125,118
  3054. ; Tuning -5
  3055.     dc.w    887,838,791,746,704,665,628,592,559,528,498,470
  3056.     dc.w    444,419,395,373,352,332,314,296,280,264,249,235
  3057.     dc.w    222,209,198,187,176,166,157,148,140,132,125,118
  3058. ; Tuning -4
  3059.     dc.w    881,832,785,741,699,660,623,588,555,524,494,467
  3060.     dc.w    441,416,392,370,350,330,312,294,278,262,247,233
  3061.     dc.w    220,208,196,185,175,165,156,147,139,131,123,117
  3062. ; Tuning -3
  3063.     dc.w    875,826,779,736,694,655,619,584,551,520,491,463
  3064.     dc.w    437,413,390,368,347,328,309,292,276,260,245,232
  3065.     dc.w    219,206,195,184,174,164,155,146,138,130,123,116
  3066. ; Tuning -2
  3067.     dc.w    868,820,774,730,689,651,614,580,547,516,487,460
  3068.     dc.w    434,410,387,365,345,325,307,290,274,258,244,230
  3069.     dc.w    217,205,193,183,172,163,154,145,137,129,122,115
  3070. ; Tuning -1
  3071.     dc.w    862,814,768,725,684,646,610,575,543,513,484,457
  3072.     dc.w    431,407,384,363,342,323,305,288,272,256,242,228
  3073.     dc.w    216,203,192,181,171,161,152,144,136,128,121,114
  3074.  
  3075. mt_chan1temp    dc.l    0,0,0,0,0,$00010000,0,  0,0,0,0
  3076. mt_chan2temp    dc.l    0,0,0,0,0,$00020000,0,  0,0,0,0
  3077. mt_chan3temp    dc.l    0,0,0,0,0,$00040000,0,  0,0,0,0
  3078. mt_chan4temp    dc.l    0,0,0,0,0,$00080000,0,  0,0,0,0
  3079.  
  3080. mt_SampleStarts    dc.l    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3081.         dc.l    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3082.  
  3083. mt_SongDataPtr    dc.l 0
  3084.  
  3085. mt_speed    dc.b 6
  3086. mt_counter    dc.b 0
  3087. mt_SongPos    dc.b 0
  3088. mt_PBreakPos    dc.b 0
  3089. mt_PosJumpFlag    dc.b 0
  3090. mt_PBreakFlag    dc.b 0
  3091. mt_LowMask    dc.b 0
  3092. mt_PattDelTime    dc.b 0
  3093. mt_PattDelTime2    dc.b 0,0
  3094.  
  3095. mt_PatternPos    dc.w 0
  3096. mt_DMACONtemp    dc.w 0
  3097.  
  3098. ;/* End of File */
  3099.  
  3100. ;    **** VARIOUS DATA ****
  3101. collctr:        ; collision variables
  3102.     dc.w    0
  3103. coll1:
  3104.     dc.w    0
  3105. coll2:
  3106.     dc.w    0
  3107.  
  3108. cheeseeaten:
  3109.     dc.w    0
  3110. cheesecount:
  3111.     dc.w    0
  3112. onept:
  3113.     dc.l    $1
  3114. fivept:
  3115.     dc.l    $50
  3116. tenpt:
  3117.     dc.l    $10
  3118. hundredpt:
  3119.     dc.l    $100
  3120. score:
  3121.     dc.l    0
  3122. hiscore:
  3123.     dc.l    0
  3124. lives:
  3125.     dc.b    STARTLIVES,0
  3126. boost:
  3127.     dc.w    0
  3128. difficulty:
  3129.     dc.w    0
  3130. invtable:
  3131.     dc.w    7,6,5,4,3,2,1,0
  3132. bitcnttable:
  3133.     dc.w    0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4
  3134. oppositetable:
  3135.     dc.w    0,2,1,0,8,0,0,0,4
  3136. selecttable:
  3137.     dc.w    1,2,4,8
  3138.     dc.w    1,2,8,4
  3139.     dc.w    1,4,2,8
  3140.     dc.w    1,4,8,2
  3141.     dc.w    1,8,2,4
  3142.     dc.w    1,8,4,2
  3143.  
  3144.     dc.w    2,1,4,8
  3145.     dc.w    2,1,8,4
  3146.     dc.w    2,4,1,8
  3147.     dc.w    2,4,8,1
  3148.     dc.w    2,8,1,4
  3149.     dc.w    2,8,4,1
  3150.  
  3151.     dc.w    4,1,2,8
  3152.     dc.w    4,1,8,2
  3153.     dc.w    4,2,1,8
  3154.     dc.w    4,2,8,1
  3155.     dc.w    4,8,1,2
  3156.     dc.w    4,8,2,1
  3157.  
  3158.     dc.w    8,1,2,4
  3159.     dc.w    8,1,4,2
  3160.     dc.w    8,2,1,4
  3161.     dc.w    8,2,4,1
  3162.     dc.w    8,4,1,2
  3163.     dc.w    8,4,2,1
  3164.  
  3165.     dc.w    1,2,4,8
  3166.     dc.w    1,2,8,4
  3167.     dc.w    1,4,2,8
  3168.     dc.w    1,4,8,2
  3169.     dc.w    1,8,2,4
  3170.     dc.w    1,8,4,2
  3171.  
  3172.     dc.w    2,1,4,8
  3173.     dc.w    2,1,8,4
  3174.     dc.w    2,4,1,8
  3175.     dc.w    2,4,8,1
  3176.     dc.w    2,8,1,4
  3177.     dc.w    2,8,4,1
  3178. pacpos:
  3179.     dc.w    $98,$d8    ; x,y
  3180. joydirection:
  3181.     dc.w    0
  3182. curdir:
  3183.     dc.w    0
  3184. dirpac:
  3185.     dc.l    pacBALL
  3186. dirctr:
  3187.     dc.w    0
  3188. pacspeed:
  3189.     dc.w    STARTSPEED    ; pacman speed, pixels/sec
  3190. testpos:
  3191.     dc.w    0,0
  3192.  
  3193. ghost1:
  3194. ; gpos
  3195.     dc.w    $38,$18
  3196. ; gdir
  3197.     dc.w    LEFT
  3198. ; gseed
  3199.     dc.l    $8742bca2
  3200. ; gright
  3201.     dc.l    g1_R
  3202. ; gleft
  3203.     dc.l    g1_L
  3204. ; gup
  3205.     dc.l    g1_U
  3206. ; gdown
  3207.     dc.l    g1_D
  3208. ; gptr
  3209.     dc.l    g11h
  3210. ; gspeed
  3211.     dc.w    1
  3212. ; gstatus
  3213.     dc.w    BAD
  3214. ; gdead
  3215.     dc.l    g1_DEAD
  3216.  
  3217. ghost2:
  3218. ; gpos
  3219.     dc.w    $68,$18
  3220. ; gdir
  3221.     dc.w    RIGHT
  3222. ; gseed
  3223.     dc.l    $8742bca2
  3224. ; gright
  3225.     dc.l    g2_R
  3226. ; gleft
  3227.     dc.l    g2_L
  3228. ; gup
  3229.     dc.l    g2_U
  3230. ; gdown
  3231.     dc.l    g2_D
  3232. ; gptr
  3233.     dc.l    g21h
  3234. ; gspeed
  3235.     dc.w    1
  3236. ; gstatus
  3237.     dc.w    BAD
  3238. ; gdead
  3239.     dc.l    g2_DEAD
  3240.  
  3241. ghost3:
  3242. ; gpos
  3243.     dc.w    $98,$18
  3244. ; gdir
  3245.     dc.w    LEFT
  3246. ; gseed
  3247.     dc.l    $6ca37503
  3248. ; gright
  3249.     dc.l    g3_R
  3250. ; gleft
  3251.     dc.l    g3_L
  3252. ; gup
  3253.     dc.l    g3_U
  3254. ; gdown
  3255.     dc.l    g3_D
  3256. ; gptr
  3257.     dc.l    g31h
  3258. ; gspeed
  3259.     dc.w    1
  3260. ; gstatus
  3261.     dc.w    BAD
  3262. ; gdead
  3263.     dc.l    g3_DEAD
  3264.  
  3265. ghost4:
  3266. ; gpos
  3267.     dc.w    $c8,$18
  3268. ; gdir
  3269.     dc.w    RIGHT
  3270. ; gseed
  3271.     dc.l    $6ca37593
  3272. ; gright
  3273.     dc.l    g4_R
  3274. ; gleft
  3275.     dc.l    g4_L
  3276. ; gup
  3277.     dc.l    g4_U
  3278. ; gdown
  3279.     dc.l    g4_D
  3280. ; gptr
  3281.     dc.l    g41h
  3282. ; gspeed
  3283.     dc.w    1
  3284. ; gstatus
  3285.     dc.w    BAD
  3286. ; gdead
  3287.     dc.l    g4_DEAD
  3288. RANDOMSEED:
  3289.     dc.l    $748c8a29
  3290. newtab:
  3291.     blk.b    16*20,0
  3292.     ;    00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19
  3293. cheese1:
  3294.     dc.b    00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
  3295.     dc.b    00,02,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,01,02,00
  3296.     dc.b    00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00
  3297.     dc.b    00,01,00,01,01,01,01,01,01,01,01,01,01,01,01,01,01,00,01,00
  3298.     dc.b    00,01,00,01,00,00,00,00,00,00,00,00,00,00,00,00,01,00,01,00
  3299.     dc.b    00,01,00,01,00,01,01,01,01,01,01,01,01,01,01,00,01,00,01,00
  3300.     dc.b    00,01,00,01,00,01,00,00,00,00,00,00,00,00,01,00,01,00,01,00
  3301.     dc.b    00,01,00,01,00,01,00,00,01,01,01,01,00,00,01,00,01,00,01,00
  3302.     dc.b    00,01,00,01,00,01,00,00,00,00,00,00,00,00,01,00,01,00,01,00
  3303.     dc.b    00,01,00,01,00,01,01,01,01,01,01,01,01,01,01,00,01,00,01,00
  3304.     dc.b    00,01,00,01,00,00,00,00,00,00,00,00,00,00,00,00,01,00,01,00
  3305.     dc.b    00,01,00,01,01,01,01,01,01,01,01,01,01,01,01,01,01,00,01,00
  3306.     dc.b    00,01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00
  3307.     dc.b    00,02,01,01,01,01,01,01,00,00,00,00,01,01,01,01,01,01,02,00
  3308.     dc.b    00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
  3309.     dc.b    00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
  3310. board1:
  3311.     dc.b    03,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,04
  3312.     dc.b    01,23,22,22,28,22,22,28,22,22,22,22,28,22,22,28,22,22,24,01
  3313.     dc.b    01,21,03,14,21,12,14,21,12,02,02,14,21,12,14,21,12,04,21,01
  3314.     dc.b    01,21,11,23,30,22,28,30,28,22,22,28,30,28,22,30,24,11,21,01
  3315.     dc.b    01,27,22,29,03,14,21,15,21,12,14,21,15,21,12,04,27,22,29,01
  3316.     dc.b    01,21,13,21,11,23,30,28,30,22,22,30,28,30,24,11,21,13,21,01
  3317.     dc.b    01,21,11,27,22,29,13,21,12,02,02,14,21,13,27,22,29,11,21,01
  3318.     dc.b    01,27,22,29,15,21,01,27,22,22,22,22,29,01,21,15,27,22,29,01
  3319.     dc.b    01,21,13,27,22,29,11,21,12,02,02,14,21,11,27,22,29,13,21,01
  3320.     dc.b    01,21,11,21,13,25,28,30,28,22,22,28,30,28,26,13,21,11,21,01
  3321.     dc.b    01,27,22,29,05,14,21,15,21,12,14,21,15,21,12,06,27,22,29,01
  3322.     dc.b    01,21,13,25,28,22,30,28,30,22,22,30,28,30,22,28,26,13,21,01
  3323.     dc.b    01,21,05,14,21,12,14,21,12,02,02,14,21,12,14,21,12,06,21,01
  3324.     dc.b    01,25,22,22,30,22,22,30,22,22,22,22,30,22,22,30,22,22,26,01
  3325.     dc.b    05,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,06
  3326.     dc.b    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
  3327. cheese2:
  3328.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3329.     dc.b    0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0
  3330.     dc.b    0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0
  3331.     dc.b    0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0
  3332.     dc.b    0,1,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0
  3333.     dc.b    0,1,0,1,1,1,0,1,1,1,1,1,1,0,1,1,1,0,1,0
  3334.     dc.b    0,1,1,1,0,1,0,0,1,0,0,1,0,0,1,0,1,1,1,0
  3335.     dc.b    0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0
  3336.     dc.b    0,1,1,1,1,1,0,1,0,0,0,0,1,0,1,1,1,1,1,0
  3337.     dc.b    0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0
  3338.     dc.b    0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,0
  3339.     dc.b    0,1,0,1,1,1,1,0,1,1,1,1,0,1,1,1,1,0,1,0
  3340.     dc.b    0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0
  3341.     dc.b    0,2,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,2,0
  3342.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3343.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3344. board2:
  3345.     dc.b    03,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,04
  3346.     dc.b    01,23,22,22,28,22,22,22,28,22,22,28,22,22,22,28,22,22,24,01
  3347.     dc.b    01,21,03,14,21,12,02,14,21,12,14,21,12,02,14,21,12,04,21,01
  3348.     dc.b    01,21,01,23,30,22,22,28,30,22,22,30,28,22,22,30,24,01,21,01
  3349.     dc.b    01,21,01,21,12,02,04,21,12,02,02,14,21,03,02,14,21,01,21,01
  3350.     dc.b    01,21,11,27,22,24,01,25,28,22,22,28,26,01,23,22,29,11,21,01
  3351.     dc.b    01,25,22,29,13,21,05,14,21,12,14,21,12,06,21,13,27,22,26,01
  3352.     dc.b    07,02,14,21,11,27,22,28,30,22,22,30,28,22,29,11,21,12,02,09
  3353.     dc.b    01,23,22,20,22,29,15,21,12,02,02,14,21,15,27,22,20,22,24,01
  3354.     dc.b    01,21,15,21,13,25,28,30,28,22,22,28,30,28,26,13,21,15,21,01
  3355.     dc.b    01,27,22,29,05,14,21,13,21,12,14,21,13,21,12,06,27,22,29,01
  3356.     dc.b    01,21,13,25,22,28,26,01,27,22,22,29,01,25,28,22,26,13,21,01
  3357.     dc.b    01,21,05,02,14,21,12,06,21,12,14,21,05,14,21,12,02,06,21,01
  3358.     dc.b    01,25,22,22,22,30,22,22,30,22,22,30,22,22,30,22,22,22,26,01
  3359.     dc.b    05,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,06
  3360.     dc.b    16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16
  3361. cheese3:
  3362.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3363.     dc.b    0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0
  3364.     dc.b    0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,1,0
  3365.     dc.b    0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0
  3366.     dc.b    0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0
  3367.     dc.b    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
  3368.     dc.b    0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0
  3369.     dc.b    0,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,0
  3370.     dc.b    0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,1,0
  3371.     dc.b    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
  3372.     dc.b    0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,0
  3373.     dc.b    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
  3374.     dc.b    0,1,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0
  3375.     dc.b    0,2,1,1,0,1,1,0,0,0,0,0,0,1,1,0,1,1,2,0
  3376.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3377.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3378. board3:
  3379.     dc.b    03,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,04
  3380.     dc.b    01,23,22,28,22,28,22,28,22,22,22,22,28,22,28,22,28,22,24,01
  3381.     dc.b    01,21,13,21,15,21,15,21,12,02,02,14,21,15,21,15,21,13,21,01
  3382.     dc.b    01,21,01,25,22,20,22,30,28,22,22,28,30,22,20,22,26,01,21,01
  3383.     dc.b    01,21,05,02,14,21,12,14,21,12,14,21,12,14,21,12,02,06,21,01
  3384.     dc.b    01,25,22,28,22,30,22,28,30,22,22,30,28,22,30,22,28,22,26,01
  3385.     dc.b    07,02,14,21,12,02,04,21,12,02,02,14,21,03,02,14,21,12,02,09
  3386.     dc.b    01,23,22,20,22,24,01,27,22,22,22,22,29,01,23,22,20,22,24,01
  3387.     dc.b    01,21,15,21,15,21,11,21,12,02,02,14,21,11,21,15,21,15,21,01
  3388.     dc.b    01,25,22,30,22,20,22,30,28,22,22,28,30,22,20,22,30,22,26,01
  3389.     dc.b    07,02,02,02,14,21,12,14,21,12,14,21,12,14,21,12,02,02,02,09
  3390.     dc.b    01,23,22,28,22,20,22,22,20,22,22,20,22,22,20,22,28,22,24,01
  3391.     dc.b    01,21,15,21,13,21,12,14,21,12,14,21,12,14,21,13,21,15,21,01
  3392.     dc.b    01,25,22,26,01,25,22,22,30,22,22,30,22,22,26,01,25,22,26,01
  3393.     dc.b    05,02,02,02,10,02,02,02,02,02,02,02,02,02,02,10,02,02,02,06
  3394.     dc.b    15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
  3395. cheese4:
  3396.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3397.     dc.b    0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0
  3398.     dc.b    0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0
  3399.     dc.b    0,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,0
  3400.     dc.b    0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0
  3401.     dc.b    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
  3402.     dc.b    0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0
  3403.     dc.b    0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0
  3404.     dc.b    0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0
  3405.     dc.b    0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
  3406.     dc.b    0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0
  3407.     dc.b    0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0
  3408.     dc.b    0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,0
  3409.     dc.b    0,2,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,2,0
  3410.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3411.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3412. board4:
  3413.     dc.b    03,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,04
  3414.     dc.b    01,23,22,28,22,28,22,28,22,28,22,22,28,22,28,22,28,22,24,01
  3415.     dc.b    01,21,15,21,15,21,15,21,13,21,12,04,21,15,21,15,21,15,21,01
  3416.     dc.b    01,27,22,20,22,20,22,29,01,25,24,01,27,22,20,22,20,22,29,01
  3417.     dc.b    01,21,15,21,15,21,15,21,05,14,21,11,21,15,21,15,21,15,21,01
  3418.     dc.b    01,27,22,20,22,20,22,20,22,28,30,22,20,22,20,22,20,22,29,01
  3419.     dc.b    01,21,15,21,15,21,15,21,13,21,12,14,21,15,21,15,21,15,21,01
  3420.     dc.b    01,27,22,20,22,20,22,29,01,27,22,22,20,22,20,22,20,22,29,01
  3421.     dc.b    01,21,15,21,15,21,15,21,11,21,12,14,21,15,21,15,21,15,21,01
  3422.     dc.b    01,27,22,20,22,20,22,20,22,30,28,22,20,22,20,22,20,22,29,01
  3423.     dc.b    01,21,15,21,15,21,15,21,12,14,21,13,21,15,21,15,21,15,21,01    
  3424.     dc.b    01,27,22,20,22,20,22,20,22,22,29,01,27,22,20,22,20,22,29,01
  3425.     dc.b    01,21,15,21,15,21,15,21,12,14,21,11,21,15,21,15,21,15,21,01
  3426.     dc.b    01,25,22,30,22,30,22,30,22,22,30,22,30,22,30,22,30,22,26,01
  3427.     dc.b    05,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,06
  3428.     dc.b    15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
  3429. cheese5:
  3430.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3431.     dc.b    0,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0
  3432.     dc.b    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  3433.     dc.b    0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0
  3434.     dc.b    0,1,0,1,0,0,1,0,1,0,0,1,0,1,0,0,1,1,1,0
  3435.     dc.b    0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0
  3436.     dc.b    0,1,0,1,0,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0
  3437.     dc.b    0,1,0,1,1,1,1,1,0,1,2,0,1,1,1,1,1,0,1,0
  3438.     dc.b    0,1,0,1,0,1,0,1,0,0,0,0,1,0,1,0,1,0,1,0
  3439.     dc.b    0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0
  3440.     dc.b    0,1,1,1,0,0,1,0,1,0,0,1,0,1,0,0,1,0,1,0
  3441.     dc.b    0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0
  3442.     dc.b    0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0
  3443.     dc.b    0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,2,0
  3444.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3445.     dc.b    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  3446. board5:
  3447.     dc.b    03,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,04
  3448.     dc.b    01,23,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,24,01
  3449.     dc.b    01,21,03,02,02,02,02,02,02,02,02,02,02,02,02,02,02,04,21,01
  3450.     dc.b    01,21,01,23,22,22,28,22,28,22,22,28,22,28,22,22,24,11,21,01
  3451.     dc.b    01,21,01,21,03,14,21,15,21,12,14,21,15,21,12,04,27,22,29,01
  3452.     dc.b    01,21,01,21,01,23,30,28,30,28,22,30,28,30,24,01,21,13,21,01
  3453.     dc.b    01,21,01,21,11,21,15,21,13,21,12,04,21,15,21,11,21,01,21,01
  3454.     dc.b    01,21,01,27,22,20,22,29,01,25,34,01,27,22,20,22,29,01,21,01
  3455.     dc.b    01,21,01,21,13,21,15,21,05,02,02,06,21,15,21,13,21,01,21,01
  3456.     dc.b    01,21,01,21,01,25,28,30,28,22,22,28,30,28,26,01,21,01,21,01
  3457.     dc.b    01,27,22,29,05,14,21,15,21,12,14,21,15,21,12,06,21,01,21,01
  3458.     dc.b    01,21,13,25,22,22,30,22,30,22,22,30,22,30,22,22,26,01,21,01
  3459.     dc.b    01,21,05,02,02,02,02,02,02,02,02,02,02,02,02,02,02,06,21,01
  3460.     dc.b    01,25,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,26,01
  3461.     dc.b    05,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,02,06
  3462.     dc.b    15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
  3463.  
  3464. scrcounter:
  3465.     dc.w    0
  3466. scrtxt:
  3467.     dc.b    " - SnackMan V1.00 07.10.92 -  "
  3468.     dc.b    " WELCOME TO SnackMan! THIS GAME WAS BROUGHT TO YOU"
  3469.     DC.B    " BY STIG A. OLSEN, ALIAS XTAZY of NEW WAVE."
  3470.     dc.b    " CODING BY ME (contact me at stigo@ifi.uio.no),"
  3471.     dc.b    " MUSIC BY STIAN W. ARNESEN (stiana@ifi.uio.no),"
  3472.     dc.b    " MUSIC REPLAYROUTINE FROM PROTRACKER BY LARS"
  3473.     DC.B    " HAMRE (Amiga Freelancers)."
  3474.     dc.b    " NON-INTERNET'ERS CONTACT ME AT"
  3475.     DC.B    " THIS SNAIL-MAIL ADDRESS: "
  3476.     dc.b    " STIG A. OLSEN, 4A311 KRINGSJAA, SOGNSVN. 218,"
  3477.     dc.b    " N-0864  OSLO, NORWAY.   "
  3478.     dc.b    " FOR MORE INFORMATION ABOUT THIS GAME, READ"
  3479.     DC.B    " THE DOCUMENTATION FILE THAT SHOULD BE ON THE SAME"
  3480.     DC.B    " DISK AS THIS GAME. You are not allowed to make any"
  3481.     dc.b    " copies without reading the documentation first!    "
  3482.     dc.b    " YOU MIGHT WONDER WHY SOMEONE WOULD WRITE A GAME THAT"
  3483.     DC.B    " LOOKS A LOT LIKE PAC-MAN, BUT I WANTED A RELATIVELY"
  3484.     DC.B    " SIMPLE PROJECT AS MY FIRST ATTEMPT TO WRITE A GAME."
  3485.     dc.b    " THIS IS NOT AN EXACT PACMAN REPLICA, I HAVEN'T PLAYED"
  3486.     DC.B    " PACMAN FOR YEARS, THIS IS A PRODUCT MADE FROM SCRATCH"
  3487.     DC.B    " BY ME."
  3488.     DC.B    " SO THIS IS IT! IF YOU DON'T LIKE IT, LEAVE IT!!!   "
  3489.     dc.b    " INSTRUCTIONS: Just eat as much cheese"
  3490.     dc.b    " (yellow dots) as possible without getting"
  3491.     dc.b    " in contact with"
  3492.     dc.b    " the ghosts. The vitamin pills (big yellow dots) make"
  3493.     dc.b    " you go twice as fast and you can"
  3494.     dc.b    " eat the ghosts for a while. Each cheese gives 10"
  3495.     dc.b    " points,"
  3496.     dc.b    " each vitamin 100, a ghost eaten gives 500,"
  3497.     dc.b    " and each level completed"
  3498.     dc.b    " gives 1000 points. You have 3 lives to begin with,"
  3499.     dc.b    " and it's impossible to get more. There are 5 levels,"
  3500.     dc.b    " when you've mastered them all the ghosts starts"
  3501.     dc.b    " going faster."
  3502.     dc.b    " Finally: Happy gaming and GOOD LUCK!"
  3503.     dc.b    "   Left mousebutton exits game!   "
  3504.     DC.B    " AND NOW THE INCREDIBLY BORING PART FOR THOSE WHO IS"
  3505.     DC.B    " NOT IN IT, THE GREETINGS LIST:"
  3506.     DC.B    " [NEW WAVE MEMBERS INCLUDING] BUSHMAN, MM, EMO, MUTANT"
  3507.     dc.b    " AND"
  3508.     DC.B    " BOLD EAGLE, [UNIVERSITY OF OSLO BUDDIES] PERPLEX"
  3509.     DC.B    "/OFFENCE (also known as FractaLarz),"
  3510.     dc.b    " QUINCY/S!P-SCOOPEX (strandeeed), QUARK or VIOL8R (how's"
  3511.     dc.b    " the flightsim coming?),"
  3512.     dc.b    " MORBID (ja til sykkelbukser!),"
  3513.     DC.B    " PUSHEAD (and nothing else matters), TOMMY ("
  3514.     dc.b    "gone '386 eh?),"
  3515.     dc.b    " JOERN <THE OMEN> T. (no peace without smoke!)"
  3516.     DC.B    " [INTERNET'ERS THAT I HAVE ENJOYED (or hated) TALKING"
  3517.     dc.b    " TO] ALL THE #amiga IRC-chatters; REALDUCK, ARE@SSB,"
  3518.     dc.b    " OLDMAN (long time, no see),"
  3519.     dc.b    " the regulars on the channel; "
  3520.     dc.b    " U4IA, CALIBURN, ILL, ZOP, FER, PUMPKIN,"
  3521.     dc.b    " PJOTR, Billy The Kid, KINTEL, CELEBRANDIL"
  3522.     dc.b    " (what an UGLY photo in DatorMz! :-) ) AND ALL I'VE"
  3523.     dc.b    " FORGOTTEN PROBABLY INCLUDING YOU!"
  3524.     dc.b    " ALSO VERY SPECIAL GREETINGS TO LARS HAMRE FOR YOUR"
  3525.     dc.b    " LONG EMAIL-LETTERS, AND THE GUYS (SHORTIE & Co.) IN"
  3526.     dc.b    " SONIC FOR KEEPING THE 'INTERNET AMIGA SCENE ADDRESS-LIST.'"
  3527.     dc.b    " A SPECIAL GREETING ALSO TO GEIR H. FOR DIGITAL (hmm..."
  3528.     dc.b    " what happened to the disk issue??)!"
  3529.     dc.b    " THE LAST (AND LEAST ---- NOT!) GREETINGS GO TO"
  3530.     dc.b    " arvidj/UiO (for the amiga section),"
  3531.     DC.B    " Lars J., Sjur K., the EON dudes from Nes, Jomar/Talent"
  3532.     dc.b    " & friends, Chris Johnsen (Canada),"
  3533.     dc.b    " Sandra Salamander, Kollbjorn Kommune and ALL"
  3534.     dc.b    " sheilas out there!"
  3535.     dc.b    " Some great greetings also to my BEER and SOCCER buddies,"
  3536.     dc.b    " Paal W. & Per Ola S. that doesn't give a shit about"
  3537.     dc.b    " computers. Party on, dudes!     "
  3538.     dc.b    " En melding til alle nordmenn: Stem JA TIL EF!!"
  3539.     dc.b    " Gi vaart konkurransedyktige naeringsliv en sjanse til"
  3540.     dc.b    " aa utnytte markedet bedre - til alles beste!   "
  3541.     dc.b    " Non norwegians: It was just a little political message!"
  3542.     dc.b    "    Everybody out there," 
  3543.     dc.b    " I love getting feedback,"
  3544.     dc.b    " so do contact me on one of the addresses listed!!"
  3545.     dc.b    " Any comments, questions, suggestions etc is welcome."
  3546.     dc.b    "            [Text Restarts]                  "
  3547.     dc.b    0
  3548.     even
  3549. scrptr:
  3550.     dc.l    scrtxt
  3551.  
  3552. ;    **** COPPERLIST/CHIPMEM DATA ****
  3553.     even
  3554. coplist:
  3555.     dc.w    $0092,$0038     ; ddfstrt
  3556.     dc.w    $0094,$00d0    ; ddfstop
  3557.     dc.w    $008e,$2c81    ; diwstrt
  3558.     dc.w    $0090,$2cc1    ; diwstop PAL
  3559.     dc.w    $0102,$0000    ; bplcon1 scroll value
  3560.     dc.w    $0108,$0000    ; odd modulo
  3561.     dc.w    $010a,$0000    ; even modulo
  3562.  
  3563. ;    **** BITPLANE POINTERS ****
  3564.  
  3565. pl1h:    dc.w    $00e0,0        ; bpl pointers
  3566.     dc.w    $00e2,0
  3567. pl2h:    dc.w    $00e4,0
  3568.     dc.w    $00e6,0
  3569. pl3h:    dc.w    $00e8,0
  3570.     dc.w    $00ea,0
  3571. pl4h:    dc.w    $00f0,0
  3572.     dc.w    $00f2,0
  3573. pl5h:    dc.w    $00ec,0
  3574.     dc.w    $00ee,0
  3575.  
  3576. pl6h:    dc.w    $00f4,0
  3577.     dc.w    $00f6,0
  3578.  
  3579. ;    **** COLOURS ****
  3580. colors:
  3581.     dc.w    $0180,$0023,$0182,$057d,$0184,$046b,$0186,$045a
  3582.     dc.w    $0188,$0359,$018a,$0347,$018c,$0b52,$018e,$00cc
  3583.  
  3584.     dc.w    $0190,$0ccc,$0192,$0ccc,$0194,$0ccc,$0196,$0ccc
  3585.     dc.w    $0198,$0ccc,$019a,$0ccc,$019c,$0ccc,$019e,$0ccc
  3586.  
  3587. spritecolors:
  3588.     dc.w    $01a0
  3589. cheesecolor:
  3590.     dc.w    $0a90    ; sprite0,1 transparency color
  3591.     dc.w    $01a2
  3592. paccolor:
  3593.     dc.w    $0dd0
  3594.     dc.w    $01a4,$00f0
  3595.     dc.w    $01a6,$000f
  3596.  
  3597.     dc.w    $01a8,$0000    ; sprite2,3
  3598.     dc.w    $01aa,$0000
  3599.     dc.w    $01ac
  3600. col12:    dc.w    $0c35
  3601.     dc.w    $01ae,$0fff
  3602.  
  3603.     dc.w    $01b0,$0ccc    ; sprite4,5
  3604.     dc.w    $01b2,$0000
  3605.     dc.w    $01b4
  3606. col34:    dc.w    $03c5
  3607.     dc.w    $01b6,$0fff
  3608.  
  3609.     dc.w    $01b8,$00ff    ; sprite6,7
  3610.     dc.w    $01ba,$0f00
  3611.     dc.w    $01bc,$00f0
  3612.     dc.w    $01be,$000f    ; color 31
  3613.  
  3614. ;    **** SPRITEPOINTERS ****
  3615.  
  3616. spr1h:    dc.w    $0120,0
  3617.     dc.w    $0122,0
  3618.     
  3619.     dc.w    $0124,0
  3620.     dc.w    $0126,0
  3621.  
  3622. g11h:    dc.w    $0128,0
  3623.     dc.w    $012a,0
  3624.  
  3625. g21h:    dc.w    $012c,0
  3626.     dc.w    $012e,0
  3627.  
  3628. g31h:    dc.w    $0130,0
  3629.     dc.w    $0132,0
  3630.  
  3631. g41h:    dc.w    $0134,0
  3632.     dc.w    $0136,0
  3633.  
  3634.     dc.w    $0138,0
  3635.     dc.w    $013a,0
  3636.  
  3637.     dc.w    $013c,0
  3638.     dc.w    $013e,0
  3639.  
  3640.  
  3641. ;    **** BITPLANE CONTROL REGS ETC ***
  3642.  
  3643.     dc.w    $2c07,$fffe
  3644.     dc.w    $0100,$5200    ; bplcon0 
  3645.  
  3646.     dc.w    $ffdf,$fffe
  3647.     dc.w    $1c07,$fffe
  3648. scr1h:
  3649.     dc.w    $00e0,0        ; bpl pointers
  3650.     dc.w    $00e2,0
  3651.  
  3652.     dc.w    $0182,$0c25
  3653.     dc.w    $ffff,$fffe
  3654.  
  3655. ;    **** GRAPHICS DATA ****
  3656. blocks:
  3657.     incbin    "blocks.raw"
  3658. board:
  3659.     incbin    "intropic.raw"
  3660. scoreboard:
  3661.     incbin    "scoreb.raw"
  3662. digits:
  3663.     incbin    "digits.raw"
  3664. infoscreen:
  3665.     blk.b    10240,0
  3666. infomsgs:
  3667.     incbin    "info.raw"
  3668. scrmem:
  3669.     blk.b    40*8,0
  3670. font8x8:
  3671.     incbin    "8x8font.raw"
  3672. cheeseboard:
  3673.     blk.b    10240,0
  3674. cheese:
  3675.     dc.w    %0000000000000000
  3676.     dc.w    %0000000000000000
  3677.     dc.w    %0000000000000000
  3678.     dc.w    %0000000000000000
  3679.     dc.w    %0000000000000000
  3680.     dc.w    %0000000000000000
  3681.     dc.w    %0000001111000000
  3682.     dc.w    %0000011111100000
  3683.     dc.w    %0000011111100000
  3684.     dc.w    %0000011111100000
  3685.     dc.w    %0000001111000000
  3686.     dc.w    %0000000000000000
  3687.     dc.w    %0000000000000000
  3688.     dc.w    %0000000000000000
  3689.     dc.w    %0000000000000000
  3690.     dc.w    %0000000000000000
  3691. vitamin:
  3692.     dc.w    %0000000000000000
  3693.     dc.w    %0000000000000000
  3694.     dc.w    %0000000000000000
  3695.     dc.w    %0000000000000000
  3696.     dc.w    %0000001111000000
  3697.     dc.w    %0000111111110000
  3698.     dc.w    %0001111111111000
  3699.     dc.w    %0001111111111000
  3700.     dc.w    %0001111111111000
  3701.     dc.w    %0001111111111000
  3702.     dc.w    %0001111111111000
  3703.     dc.w    %0000111111110000
  3704.     dc.w    %0000001111000000
  3705.     dc.w    %0000000000000000
  3706.     dc.w    %0000000000000000
  3707.     dc.w    %0000000000000000
  3708.  
  3709. pacR:
  3710.     dc.w    $0000,$0000,$03e0,$0000,$0ff8,$0000,$1ffc,$0000
  3711.     dc.w    $3ff8,$0000,$3ff0,$0000,$7fe0,$0000,$7fc0,$0000
  3712.     dc.w    $7f80,$0000,$7fc0,$0000,$7fe0,$0000,$3ff0,$0000
  3713.     dc.w    $3ff8,$0000,$1ffc,$0000,$0ff8,$0000,$03e0,$0000
  3714.     dc.w    $0000,$0000
  3715.     dc.w    $0000,$0000
  3716. pacL:
  3717.     dc.w    $0000,$0000,$03e0,$0000,$0ff8,$0000,$1ffc,$0000
  3718.     dc.w    $0ffe,$0000,$07fe,$0000,$03ff,$0000,$01ff,$0000
  3719.     dc.w    $00ff,$0000,$01ff,$0000,$03ff,$0000,$07fe,$0000
  3720.     dc.w    $0ffe,$0000,$1ffc,$0000,$0ff8,$0000,$03e0,$0000
  3721.     dc.w    $0000,$0000
  3722.     dc.w    $0000,$0000
  3723. pacU:
  3724.     dc.w    $0000,$0000,$0000,$0000,$0000,$0000,$1004,$0000
  3725.     dc.w    $380e,$0000,$3c1e,$0000,$7e3f,$0000,$7f7f,$0000
  3726.     dc.w    $7fff,$0000,$7fff,$0000,$7fff,$0000,$3ffe,$0000
  3727.     dc.w    $3ffe,$0000,$1ffc,$0000,$0ff8,$0000,$03e0,$0000
  3728.     dc.w    $0000,$0000
  3729.     dc.w    $0000,$0000
  3730. pacD:    
  3731.     dc.w    $0000,$0000,$03e0,$0000,$0ff8,$0000,$1ffc,$0000
  3732.     dc.w    $3ffe,$0000,$3ffe,$0000,$7fff,$0000,$7fff,$0000
  3733.     dc.w    $7fff,$0000,$7f7f,$0000,$7e3f,$0000,$3c1e,$0000
  3734.     dc.w    $380e,$0000,$1004,$0000,$0000,$0000,$0000,$0000
  3735.     dc.w    $0000,$0000
  3736.     dc.w    $0000,$0000
  3737. pacBALL:
  3738.     dc.w    $0000,$0000
  3739.     dc.w    $03e0,$0000,$0ff8,$0000,$1ffc,$0000
  3740.     dc.w    $3ffe,$0000,$3ffe,$0000,$7fff,$0000,$7fff,$0000
  3741.     dc.w    $7fff,$0000,$7fff,$0000,$7fff,$0000,$3ffe,$0000
  3742.     dc.w    $3ffe,$0000,$1ffc,$0000,$0ff8,$0000,$03e0,$0000
  3743.     dc.w    $0000,$0000
  3744.     dc.w    $0000,$0000
  3745. nullspr:
  3746.     dc.w    $0000,$0000,$0000,$00000
  3747.     dc.w    $0000,$0000
  3748. g1_R:
  3749.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3750.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$79ce,$0e70,$79ce
  3751.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3752.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3753.     dc.w    $0000,$0000
  3754.     dc.w    $0000,$0000
  3755. g1_L:
  3756.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3757.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$739e,$0e70,$739e
  3758.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3759.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3760.     dc.w    $0000,$0000
  3761.     dc.w    $0000,$0000
  3762. g1_U:
  3763.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3764.     dc.w    $0e70,$799e,$0e70,$799e,$0e70,$7ffe,$0e70,$7ffe
  3765.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3766.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3767.     dc.w    $0000,$0000
  3768.     dc.w    $0000,$0000
  3769. g1_D:
  3770.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3771.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$799e,$0e70,$799e
  3772.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3773.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3774.     dc.w    $0000,$0000
  3775.     dc.w    $0000,$0000
  3776.  
  3777. g2_R:
  3778.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3779.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$79ce,$0e70,$79ce
  3780.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3781.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3782.     dc.w    $0000,$0000
  3783.     dc.w    $0000,$0000
  3784. g2_L:
  3785.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3786.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$739e,$0e70,$739e
  3787.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3788.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3789.     dc.w    $0000,$0000
  3790.     dc.w    $0000,$0000
  3791. g2_U:
  3792.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3793.     dc.w    $0e70,$799e,$0e70,$799e,$0e70,$7ffe,$0e70,$7ffe
  3794.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3795.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3796.     dc.w    $0000,$0000
  3797.     dc.w    $0000,$0000
  3798. g2_D:
  3799.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3800.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$799e,$0e70,$799e
  3801.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3802.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3803.     dc.w    $0000,$0000
  3804.     dc.w    $0000,$0000
  3805. g3_R:
  3806.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3807.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$79ce,$0e70,$79ce
  3808.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3809.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3810.     dc.w    $0000,$0000
  3811.     dc.w    $0000,$0000
  3812. g3_L:
  3813.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3814.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$739e,$0e70,$739e
  3815.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3816.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3817.     dc.w    $0000,$0000
  3818.     dc.w    $0000,$0000
  3819. g3_U:
  3820.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3821.     dc.w    $0e70,$799e,$0e70,$799e,$0e70,$7ffe,$0e70,$7ffe
  3822.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3823.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3824.     dc.w    $0000,$0000
  3825.     dc.w    $0000,$0000
  3826. g3_D:
  3827.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3828.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$799e,$0e70,$799e
  3829.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3830.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3831.     dc.w    $0000,$0000
  3832.     dc.w    $0000,$0000
  3833. g4_R:
  3834.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3835.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$79ce,$0e70,$79ce
  3836.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3837.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3838.     dc.w    $0000,$0000
  3839.     dc.w    $0000,$0000
  3840. g4_L:
  3841.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3842.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$739e,$0e70,$739e
  3843.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3844.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3845.     dc.w    $0000,$0000
  3846.     dc.w    $0000,$0000
  3847. g4_U:
  3848.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3849.     dc.w    $0e70,$799e,$0e70,$799e,$0e70,$7ffe,$0e70,$7ffe
  3850.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3851.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3852.     dc.w    $0000,$0000
  3853.     dc.w    $0000,$0000
  3854. g4_D:
  3855.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1ff8,$0000,$7ffe
  3856.     dc.w    $0e70,$7ffe,$0e70,$7ffe,$0e70,$799e,$0e70,$799e
  3857.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$7ffe,$0000,$7ffe
  3858.     dc.w    $0000,$7ffe,$0000,$7ffe,$0000,$6666,$0000,$6666
  3859.     dc.w    $0000,$0000
  3860.     dc.w    $0000,$0000
  3861.  
  3862. g1_DEAD:
  3863.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1008,$0000,$700e
  3864.     dc.w    $0000,$4c32,$0000,$524a,$0000,$524a,$0000,$524a
  3865.     dc.w    $0000,$4c32,$0000,$4002,$0000,$4002,$0000,$4002
  3866.     dc.w    $0000,$4002,$0000,$599a,$0000,$6666,$0000,$6666
  3867.     dc.w    $0000,$0000
  3868.     dc.w    $0000,$0000
  3869. g2_DEAD:
  3870.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1008,$0000,$700e
  3871.     dc.w    $0000,$4c32,$0000,$524a,$0000,$524a,$0000,$524a
  3872.     dc.w    $0000,$4c32,$0000,$4002,$0000,$4002,$0000,$4002
  3873.     dc.w    $0000,$4002,$0000,$599a,$0000,$6666,$0000,$6666
  3874.     dc.w    $0000,$0000
  3875.     dc.w    $0000,$0000
  3876. g3_DEAD:
  3877.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1008,$0000,$700e
  3878.     dc.w    $0000,$4c32,$0000,$524a,$0000,$524a,$0000,$524a
  3879.     dc.w    $0000,$4c32,$0000,$4002,$0000,$4002,$0000,$4002
  3880.     dc.w    $0000,$4002,$0000,$599a,$0000,$6666,$0000,$6666
  3881.     dc.w    $0000,$0000
  3882.     dc.w    $0000,$0000
  3883. g4_DEAD:
  3884.     dc.w    $0000,$0000,$0000,$1ff8,$0000,$1008,$0000,$700e
  3885.     dc.w    $0000,$4c32,$0000,$524a,$0000,$524a,$0000,$524a
  3886.     dc.w    $0000,$4c32,$0000,$4002,$0000,$4002,$0000,$4002
  3887.     dc.w    $0000,$4002,$0000,$599a,$0000,$6666,$0000,$6666
  3888.     dc.w    $0000,$0000
  3889.     dc.w    $0000,$0000
  3890.  
  3891. efcoplist:
  3892.     dc.w    $0092,$0038     ; ddfstrt
  3893.     dc.w    $0094,$00d0    ; ddfstop
  3894.     dc.w    $008e,$2c81    ; diwstrt
  3895.     dc.w    $0090,$2cc1    ; diwstop PAL
  3896.     dc.w    $0102,$0000    ; bplcon1 scroll value
  3897.     dc.w    $0108,$0000    ; odd modulo
  3898.     dc.w    $010a,$0000    ; even modulo
  3899.  
  3900. ;    **** BITPLANE POINTERS ****
  3901.  
  3902. ef1h:    dc.w    $00e0,0        ; bpl pointers
  3903.     dc.w    $00e2,0
  3904. ef2h:    dc.w    $00e4,0
  3905.     dc.w    $00e6,0
  3906. ef3h:    dc.w    $00e8,0
  3907.     dc.w    $00ea,0
  3908. efccol:
  3909.     dc.w    $0180,$0fff,$0182,$0fff,$0184,$0fff
  3910.     dc.w    $0186,$0fff,$0188,$0fff
  3911.     dc.w    $018a,$0fff,$018c,$0fff,$018e,$0fff
  3912.  
  3913.     dc.w    $0100,$3200
  3914.     dc.w    $ffff,$fffe
  3915.  
  3916. efscreen:
  3917.     incbin    "jatilef.raw"
  3918. efcol:
  3919.     dc.w    $0128,$0bbb,$0889
  3920.     dc.w    $0332,$0126
  3921.     dc.w    $0eb0,$0a70,$0b02
  3922.  
  3923. intdcoplist:
  3924.     dc.w    $0092,$0038     ; ddfstrt
  3925.     dc.w    $0094,$00d0    ; ddfstop
  3926.     dc.w    $008e,$2c81    ; diwstrt
  3927.     dc.w    $0090,$2cc1    ; diwstop PAL
  3928.     dc.w    $0102,$0000    ; bplcon1 scroll value
  3929.     dc.w    $0108,$0000    ; odd modulo
  3930.     dc.w    $010a,$0000    ; even modulo
  3931.  
  3932. ;    **** BITPLANE POINTERS ****
  3933.  
  3934. intd1h:    dc.w    $00e0,0        ; bpl pointers
  3935.     dc.w    $00e2,0
  3936. intd2h:    dc.w    $00e4,0
  3937.     dc.w    $00e6,0
  3938. intd3h:    dc.w    $00e8,0
  3939.     dc.w    $00ea,0
  3940. intd4d:    dc.w    $00ec,0
  3941.     dc.w    $00ee,0
  3942. intd5d:    dc.w    $00f0,0
  3943.     dc.w    $00f2,0
  3944.  
  3945. introccol:
  3946.     dc.w    $0180,$0000,$0182,$0000,$0184,$0000,$0186,$0000
  3947.     dc.w    $0188,$0000,$018a,$0000,$018c,$0000,$018e,$0000
  3948.     dc.w    $0190,$0000,$0192,$0000,$0194,$0000,$0196,$0000
  3949.     dc.w    $0198,$0000,$019a,$0000,$019c,$0fff,$019e,$0fff
  3950.     dc.w    $01a0,$0fff,$01a2,$0fff,$01a4,$0fff,$01a6,$0fff
  3951.     dc.w    $01a8,$0fff,$01aa,$0fff,$01ac,$0fff,$01ae,$0fff
  3952.     dc.w    $01b0,$0fff,$01b2,$0fff,$01b4,$0fff,$01b6,$0fff
  3953.     dc.w    $01b8,$0fff,$01ba,$0fff,$01bc,$0fff,$01be,$0fff
  3954.  
  3955.     dc.w    $0100,$5200
  3956.     dc.w    $ffff,$fffe
  3957. introcol:
  3958.     dc.w    $0000,$0bcf,$09bd,$089c
  3959.     dc.w    $068a,$0579,$0467,$0356
  3960.     dc.w    $0fe4,$0eb3,$0d93,$0c72
  3961.     dc.w    $0831,$0fe0,$0def,$0bdf
  3962.     dc.w    $09ce,$07ae,$069e,$048d
  3963.     dc.w    $037d,$016d,$015b,$005a
  3964.     dc.w    $0437,$0048,$0426,$0037
  3965.     dc.w    $0325,$0314,$0203,$0000
  3966. efcol2:
  3967. introcol2:
  3968.     dc.w    $0000,$0000,$0000,$0000
  3969.     dc.w    $0000,$0000,$0000,$0000
  3970.     dc.w    $0000,$0000,$0000,$0000
  3971.     dc.w    $0000,$0000,$0000,$0000
  3972.     dc.w    $0000,$0000,$0000,$0000
  3973.     dc.w    $0000,$0000,$0000,$0000
  3974.     dc.w    $0000,$0000,$0000,$0000
  3975.     dc.w    $0000,$0000,$0000,$0000
  3976. ;    **** MUSIC MODULE ****
  3977. mt_data:
  3978.     incbin    "mod.swa-snackman_music"    
  3979.     dc.l    0
  3980.